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 / Actual Terrain X,Y,Z?

Author
Message
Etane
16
Years of Service
User Offline
Joined: 13th Jan 2008
Location:
Posted: 13th Jan 2008 21:33
So i just started using DGDK and so far i havent had a problem, however I've decided i wanted to make a small 3D rts , i loaded my terrain , made my objects tested basic movement (walking on y axis of terrain and all that) now im trying to make a object that wherever i click on the terrain it will go to the terrain's Y Value (+20 or something like that) and then the X and Y cords of where i clicked .... i haven't any idea how to do it.
tempicek
16
Years of Service
User Offline
Joined: 27th Nov 2007
Location: Prague
Posted: 13th Jan 2008 23:02
Use this function to obtain terrain's height in specified location:

dbGetTerrainGroundHeight ( int iID, float fX, float fZ )

and follow the description I've provided in this thread:

http://forum.thegamecreators.com/?m=forum_view&t=121802&b=22
Etane
16
Years of Service
User Offline
Joined: 13th Jan 2008
Location:
Posted: 13th Jan 2008 23:48 Edited at: 14th Jan 2008 07:36
Ok, thats a really nice explanation ^^ , however thats the first thing i tried , but my problem is that the object will not go to right where the mouse is pointing on the terrain... i'll mess with it a little and hopefully i can fix it, thanks again
Etane
16
Years of Service
User Offline
Joined: 13th Jan 2008
Location:
Posted: 14th Jan 2008 07:35
Ok i understand your method but is there a chance you could post a little smaple snippet to show exactly what you mean ? i would be a Huge help. but if you cant thanks for your help thus far.
Etane
16
Years of Service
User Offline
Joined: 13th Jan 2008
Location:
Posted: 15th Jan 2008 01:18
so can i use that one function that gets the screen coordinates and thne convert it into the position on the terrain???
Alfie
16
Years of Service
User Offline
Joined: 25th Dec 2007
Location:
Posted: 3rd Feb 2008 08:16
Hey Etane, did you figure it out? If not I think I made a pretty simple way to do it here

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

Login to post a reply

Server time is: 2024-10-08 15:48:50
Your offset time is: 2024-10-08 15:48:50