Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / How to attach 3D objects without using limbs

Author
Message
zamfir
21
Years of Service
User Offline
Joined: 4th Nov 2003
Location:
Posted: 9th May 2004 20:49
I'm using Nuclear Glory collision, and I have been trying to use invisible plains (why do we call them 'plains instead of 'planes'?) to make invisible feelers for non player objects. Sort of like the AI for those little mouse robots, where if the bump something to the right, they turn left, if they bump something to the left, they turn right, if they bump something in front, they turn around 180 degrees, etc. I want to do this with invisible limbs because I want my objects to seem intellingent enough to avoid sliding along walls. I have found, though, that NG collision does not support "limbs" and I am not quite sure how to attach an object to another object and maintain the proper position when rotated etc. Has anyone dealt with this yet? I do not want the 'feelers' to be considered part of the non player object for anything other than pathfinding purposes, (I don't want bullets to collide with them, etc). Any ideas?

Pheonixx
21
Years of Service
User Offline
Joined: 6th Oct 2003
Location: Columbus, Ohio
Posted: 9th May 2004 21:31
handle it entirely in mathematics.

rem assuming objectB is higher in x value

if objectA.xloc < objectB.xloc - 10
rem you can go this way
endif

it's tedious, but possible. do that simple formula for each possible direction of movement.

zamfir
21
Years of Service
User Offline
Joined: 4th Nov 2003
Location:
Posted: 10th May 2004 07:05
That won't work when the walls my non user objects are trying not to run into are all one large .X level.



zamfir
21
Years of Service
User Offline
Joined: 4th Nov 2003
Location:
Posted: 10th May 2004 07:12
Not to mention I'm talking about objects that essentially behave as limbs, that rotate as my object rotates. Imagine a car. Ok if you want it to maneuver autonimously (sp?) on a very simple level, you put a sensor to the front left, and one to the front right. If the front left sensor detects a collision, the car would be programmed to turn away from that collision, and therefore would turn right. The sensor needs to be attached to the car. This is so that my little cars would have the basic AI to manuever through a maze with something that approximates intelligence. If both of the sensors were feeling a collision, the car would say, "ok, lets rotate 180 degrees and head out the way we came, this looks like a dead end."
This really shouldn't be that crazy hard, but for some stupid reason no one has thought to include this most basic behavior in DB or NG Collision. So what to do, what to do?

walaber
21
Years of Service
User Offline
Joined: 22nd Oct 2003
Location: Los Angeles, CA
Posted: 10th May 2004 07:28
a slightly over-complex solution would be this.

1) make an object that has several limbs for "feelers".
2)position your main object at the position/rotation like this:
position object MainObj, limb position x(LimbObj, 0), limb position y(LimbObj, 0), limb position z(LimbObj, 0)

2) position your feeler objects similarly, but using the appropriate limb numbers.

make sure when you want to move your main character, you move the limb object instead. you could also use rotation commands like the position commands.

Go Go Gadget DBPRO!

Athlon XP 2400+ || DDR-SDRAM 1GB || Nvidia GeForce 4 Ti4200 AGP 8x 128MB
zamfir
21
Years of Service
User Offline
Joined: 4th Nov 2003
Location:
Posted: 11th May 2004 20:38
The only problem with that is that those limbs, however invisible, would be collision objects for NG Collision. Can you see the conundrum here?

zamfir
21
Years of Service
User Offline
Joined: 4th Nov 2003
Location:
Posted: 19th May 2004 20:48
this question hasn't been answered to my satisfaction so <BUMP>

Ron Erickson
Moderator
22
Years of Service
User Offline
Joined: 6th Dec 2002
Location: Pittsburgh, PA, USA
Posted: 19th May 2004 21:08 Edited at: 19th May 2004 21:10
I am currently working on EZrotate enhanced. One of the features of it will let you set up points that act as "offsets" distances from an object. The plugin will return the positions of those points as you move and rotate your object.

For example, if you set up a point that is 3 units in front (+Z axis)of your object you would use something like:
OffsetX# = 0
OffsetY# = 0
OffsetZ# = 3
Xpos# = EZro_ObjGetPointOffX(ObjNo,OffsetX#,OffsetY#,OffsetZ#)
Ypos# = EZro_ObjGetPointOffX(ObjNo,OffsetX#,OffsetY#,OffsetZ#)
Zpos# = EZro_ObjGetPointOffX(ObjNo,OffsetX#,OffsetY#,OffsetZ#)

The world position of the point would be Xpos#,Ypos#,Zpos#. The point returned would always be 3 units in front of your object on it's own local axis.

If you want to see a demo of that feature, download this demo of the EZrotate enhanced features:
http://www.ericksonline.com/EZRotate/enhanced/EZrotateEnhancedTech1.zip
When you do local and global rotation, notice how the red point is translated with the object.

The dll should be ready soon....

EZrotate!
Tokamak Physics Wrapper!
eat much pie
21
Years of Service
User Offline
Joined: 9th Apr 2004
Location: Within the mind of a lowly mortal...
Posted: 19th May 2004 22:59
I've just downloaded the Newton wrapper and DLL (the link to which can be found on the 'program announcements' forum at the top) that handles objects just like in real life (ie. you set each object's mass, elasticity, rotational resistance, etc) so it reacts just like in reality. There are 8 demos to show what it actually does.

This DLL does all the work for you, so if you want more customisability the EZ rotate dll might be better, although I've never used it.

Hope that helps!

http://www.nuclearglory.com/?i=453288050 : Nuclear Glory, AMAZING COLLISION SYSTEM!
KC27
21
Years of Service
User Offline
Joined: 18th Mar 2004
Location:
Posted: 20th May 2004 05:40
They are called "plains" because they are a flat object area, planes refers to carpentery terms or aeronautics.

Give All The Credit Away
zamfir
21
Years of Service
User Offline
Joined: 4th Nov 2003
Location:
Posted: 21st May 2004 02:45
Actually, a plane is a geometrical term, a 2D plane that has infinite width and height, but zero depth. I would assume the developers, understanding that "plains" would have finite width and height but were still very similar to planes, split the difference.

On the other subject, it appears that EZrotate would indeed, when patched up to this new version, have the ability to do what I need done. I have not looked at the "Newton Wrapper" but it sounds like some of its funcionality would conflict with Nuclear Glory collision functionality, and I did not hear that it would actually address the problem as I stated it above.

Look forward to seeing EZRotate Enhanced. Anyone else have any ideas?

I would think this would be a universal concern, particularly for AI pathfinding issues.

Marthik
21
Years of Service
User Offline
Joined: 25th Jan 2004
Location: Washington State, USA
Posted: 21st May 2004 06:10
did u think of, using ray cast, to find collision to the right or left, and then you can see how close they are, and if they are close enough, then you can turn your creature.
zamfir
21
Years of Service
User Offline
Joined: 4th Nov 2003
Location:
Posted: 21st May 2004 17:22
No, actually I've never even seen that. Can you give me an idea of how I would do that?

Marthik
21
Years of Service
User Offline
Joined: 25th Jan 2004
Location: Washington State, USA
Posted: 22nd May 2004 00:53
well in NGC there are some commands that will help
First you use one of these:

RayIntersectObjectPRO()
RayIntersectTypePRO()

to find if there is a collision
once you know that there is a collision you can find the distance by:

RayHitDistPRO()

and that should be it.

Login to post a reply

Server time is: 2025-06-08 04:00:52
Your offset time is: 2025-06-08 04:00:52