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.

3 Dimensional Chat / .x terrain mesh. How do I get the height?

Author
Message
PAGAN_old
18
Years of Service
User Offline
Joined: 28th Jan 2006
Location: Capital of the Evil Empire
Posted: 11th Jun 2007 07:46
I have made a terrain and exported it as a .x model. Since i didn't really experiment with .x terrains before, after half an hour of trying to figure this out, I have decided to ask, how do you get the height if a .x terrain mesh?

dont hate people who rip you off,cheat and get away with it, learn from them
Brain111
17
Years of Service
User Offline
Joined: 5th Feb 2007
Location: In my own little world.
Posted: 11th Jun 2007 07:57
Hmm... I think this should be in the darkbasic chat, but oh well.

The only way I know of to find the height of a .x object is using Intersect Object. You would use the command like this:



In case you dont know how this command works, this would draw a vertical line at x#,z#, and see what the distance from the terrain is. Note that if your level's maximum height goes about 1000, you will have to change this number to a different one. Also note that if x#,z# is not on your level, the raycast will totally miss it, and return a 0, and in this example, give the terrain a height of 1000.
PAGAN_old
18
Years of Service
User Offline
Joined: 28th Jan 2006
Location: Capital of the Evil Empire
Posted: 11th Jun 2007 09:29
when I applied this (thanks this works good) my screen stuttered once in while?

i think this has something to do with that.

dont hate people who rip you off,cheat and get away with it, learn from them
Brain111
17
Years of Service
User Offline
Joined: 5th Feb 2007
Location: In my own little world.
Posted: 11th Jun 2007 16:51
That's wierd, what do you mean by it stuttered? Like the whole screen would move, or the terrain object would move, or what?
PAGAN_old
18
Years of Service
User Offline
Joined: 28th Jan 2006
Location: Capital of the Evil Empire
Posted: 11th Jun 2007 18:05 Edited at: 11th Jun 2007 20:08
never mind, i fixed it, didn't ave anything to do with your system.

Thanks.

dont hate people who rip you off,cheat and get away with it, learn from them
PAGAN_old
18
Years of Service
User Offline
Joined: 28th Jan 2006
Location: Capital of the Evil Empire
Posted: 11th Jun 2007 18:36
Actually, its weird, sometimes i see the whole screen studder (upwards) and sometimes only some objects studder (and others don't)

dont hate people who rip you off,cheat and get away with it, learn from them
Brain111
17
Years of Service
User Offline
Joined: 5th Feb 2007
Location: In my own little world.
Posted: 11th Jun 2007 20:55
That's really wierd, it only does that in this game or all of your stuff?
PAGAN_old
18
Years of Service
User Offline
Joined: 28th Jan 2006
Location: Capital of the Evil Empire
Posted: 11th Jun 2007 20:59
in the game. It turned out to be a result of an unfinished timer sequence, not your system. I fixed it

Thanks for your help!

dont hate people who rip you off,cheat and get away with it, learn from them
PAGAN_old
18
Years of Service
User Offline
Joined: 28th Jan 2006
Location: Capital of the Evil Empire
Posted: 22nd Jun 2007 10:47 Edited at: 22nd Jun 2007 11:04
man, this process really kills my fps. 20- 30 point are killed!

please, don't tell me that there is no other way, that won't kill fps.

basically I want to make things move on a .x terrain plane i made.

I am thinking of changing the previous system i had to something that uses collision or possibly physics. as long as its not very fps killing

dont hate people who rip you off,cheat and get away with it, learn from them
Brain111
17
Years of Service
User Offline
Joined: 5th Feb 2007
Location: In my own little world.
Posted: 27th Jun 2007 03:45
Yeah it does suck up alot of fps, depending on how big your landscape is. It would save alot, though, to divide your landscape into a grid of seperate objects, and then use your player's position to figure out which one he is on. This way, it wouldn't have to do raycast checks on as many polys.
PAGAN_old
18
Years of Service
User Offline
Joined: 28th Jan 2006
Location: Capital of the Evil Empire
Posted: 27th Jun 2007 05:12
wait! it does raycast on the whole terrain?

i thought it did it only at the x,z position of an object.

dont hate people who rip you off,cheat and get away with it, learn from them
Brain111
17
Years of Service
User Offline
Joined: 5th Feb 2007
Location: In my own little world.
Posted: 27th Jun 2007 05:17
Yeah it only does one raycast, in this case at the x,z of an object. BUT this ray has to be tested on every single polygon of your mesh. And that means that meshes with tons of polygons will take a longer time to be checked. So you could make it easier on your computer by dividing your terrain up and only checking it on the section that you really need to.
PAGAN_old
18
Years of Service
User Offline
Joined: 28th Jan 2006
Location: Capital of the Evil Empire
Posted: 27th Jun 2007 23:53
is it possible for a method similar to this without the actual testing of every polygon part?

i got nothing against dividing my mesh, i know will have to do it anyway.

dont hate people who rip you off,cheat and get away with it, learn from them
The crazy
19
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Behind you
Posted: 28th Jun 2007 07:42
good ol' sparky's always works for me

Login to post a reply

Server time is: 2024-11-26 06:34:25
Your offset time is: 2024-11-26 06:34:25