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.

Dark GDK / Using .X file as terrain?

Author
Message
FFB
16
Years of Service
User Offline
Joined: 4th Mar 2008
Location:
Posted: 5th Mar 2008 17:50
Is it possible for me to use a .X file I've created as terrain? I can load it as an object, but then how do I get the height at a specific X / Z location so I can position my camera?

Thanks!
jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 5th Mar 2008 19:19
Yes.

Pick a fixed point above the Terrain (higher than all ground) and Raycast down. You can usually find out how far the ray traveled before it hit the ground. Then you Do Math on your fixed height and the raycast hit.

Raycast? Look For Sparky's DLL - he has a DarkGDK Lib you can use that has this functionality.

another method requires something called interpolation but you need a memblock or an array with the values of all the verts. Additionally they need to be arranged in a way that the math will work. This can easily get more complex than necessary.

Sparky's is great.

In Fact, I have code (some of it commented out but should help ya) in my jgc_vmesh.cpp file, in my Darkgdk oop library I have here (Search for jthe jgc_vmesh.cpp file, search for the work ground. Sparky's header file is called: SC_Collision.h or something and the file is in these forums I also posted a copy on page two) of this thread:

http://forum.thegamecreators.com/?m=forum_view&t=124748&b=22

Login to post a reply

Server time is: 2024-09-29 13:33:34
Your offset time is: 2024-09-29 13:33:34