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 / Is It Possible To Create a Mesh, and Then Get It's Height (Like "Get Terrain Height")

Author
Message
CornStalks
21
Years of Service
User Offline
Joined: 12th Feb 2004
Location: Utah
Posted: 12th Jul 2005 04:26
I want to make a mesh (which I can already do), but I want to be able to get the height and position an object on the mesh. I would just use terrains, but I can't change the size or the number of segments in a terrain. If you still don't get what I'm asking, think of using the command "Get Terrain Height", but instead of using a terrain, I want to use an object. It would also need to be pretty quick since I would have to be placing a few hundered objects.
Pheonixx
21
Years of Service
User Offline
Joined: 6th Oct 2003
Location: Columbus, Ohio
Posted: 12th Jul 2005 05:15 Edited at: 12th Jul 2005 05:17
Quote: "INTERSECT OBJECT
This command will return the distance to the point of intersection between two coordinates, in reference
to the specified object. Use this command to project a line from your current position to a destination to
determine whether a collision will occur with an object. Ideal for bullet calculations and fast manual
polygon collision.

SYNTAX
Return Float=INTERSECT OBJECT(Object Number, X, Y, Z, ToX, ToY, ToZ)"



ALSO....

If you are going to have hundreds of objects, consider instancing, cloning, or making them limbs (such as corn, limb 1, offset x, offset y, offset z)... great for static maps... more complicated to use in scrolling maps.

http://ausukusa.breakset.com
CornStalks
21
Years of Service
User Offline
Joined: 12th Feb 2004
Location: Utah
Posted: 12th Jul 2005 12:58
Sweet, I just thought that command would tell you if you were going to collide, not how far away you are. Yeah, I think I would be instancing or cloning, just to make unit creation faster. Thanks.
CornStalks
21
Years of Service
User Offline
Joined: 12th Feb 2004
Location: Utah
Posted: 14th Jul 2005 10:11
Okay, nevermind, I can't get it to work. Shouldn't the code below work?

I don't know why it works. When I run it the sphere just moves down. If I remove the part that says "object position y(1)-" (in the positioning portion), then the sphere doesn't move up or down. Why won't it work?
Azrael
20
Years of Service
User Offline
Joined: 2nd Mar 2005
Location: Germany
Posted: 14th Jul 2005 15:05
Try this:


CornStalks
21
Years of Service
User Offline
Joined: 12th Feb 2004
Location: Utah
Posted: 16th Jul 2005 03:55
I have no idea why you need that +5, or why you have to use the plain instead of the sphere for the intersection, but it works. THANKS!

Login to post a reply

Server time is: 2025-06-06 22:26:10
Your offset time is: 2025-06-06 22:26:10