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 / cant use Get Terrain height

Author
Message
Ghost Games
18
Years of Service
User Offline
Joined: 1st Aug 2007
Location:
Posted: 12th Jun 2015 22:05
Hi

I got my terrain imported as an .x file and then i can see i cant use the command Get Terrain height. is there another way to calculate the height on a terrain other then Get terrain height and get maxrix height???

Thx
Scorpyo
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: italy
Posted: 12th Jun 2015 22:30 Edited at: 12th Jun 2015 22:33

notes:
10000 and -10000 are the max and min heights checked , in DBP units.
If your terrain exceeds 10000 or -10000 height units change those numbers accordingdly.

Cheers
Scorpyo
Derek Darkly
13
Years of Service
User Offline
Joined: 22nd Sep 2011
Location: Whats Our Vector, Victor?
Posted: 13th Jun 2015 00:22
If you're using Advanced Terrain you'll need to use GET TERRAIN GROUND HEIGHT

Green Gandalf
VIP Member
20
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 13th Jun 2015 00:54
Quote: "If you're using Advanced Terrain you'll need to use GET TERRAIN GROUND HEIGHT"


He's not - he's using an imported .x file which will be a standard object not an advanced terrain object. Scorpyo's method is what I use in such cases.



Powered by Free Banners
Derek Darkly
13
Years of Service
User Offline
Joined: 22nd Sep 2011
Location: Whats Our Vector, Victor?
Posted: 13th Jun 2015 01:33
Quote: " he's using an imported .x file which will be a standard object "


Interesting, I have used Sparky's on imported terrain objects with success before, but I'm surprised that INTERSECT OBJECT would work this way... I thought the collision boundaries on objects was typically a box or sphere...??

Ghost Games
18
Years of Service
User Offline
Joined: 1st Aug 2007
Location:
Posted: 13th Jun 2015 08:29
Thx Scorpyo's you are the man. code snippet workes nice

Derek Darkly, i use World Creator combined with 3dsmax 2012 and the plugin DreamScape for 3dsmax it makes some nice terrains. and with this code snippet i can calculate the distance between my player object and the terrain.

so nice... thx Again
Green Gandalf
VIP Member
20
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 13th Jun 2015 12:35
@Derek Darkly

From the Help file for intersect object():

Quote: "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."


It gives accurate intersection points with polygons rather than collision boxes etc.



Powered by Free Banners
Derek Darkly
13
Years of Service
User Offline
Joined: 22nd Sep 2011
Location: Whats Our Vector, Victor?
Posted: 13th Jun 2015 16:32
Quote: "It gives accurate intersection points with polygons rather than collision boxes etc."


Awesome, I never realized that. I thought it was just a claim that DBP couldn't back up.

If it's so accurate for collision, then I assume that you could use it for every object in your world, then?

Derek Darkly
13
Years of Service
User Offline
Joined: 22nd Sep 2011
Location: Whats Our Vector, Victor?
Posted: 13th Jun 2015 16:39 Edited at: 13th Jun 2015 16:42
Quote: "Derek Darkly, i use World Creator combined with 3dsmax 2012 and the plugin DreamScape for 3dsmax it makes some nice terrains"


Nice, I'd love to see some screenies of these terrains!

Last year I was playing around with Random Heightmap Generation and I even started a terrain (.X) output program called "TerraSite"



Green Gandalf
VIP Member
20
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 13th Jun 2015 16:55
Quote: "If it's so accurate for collision, then I assume that you could use it for every object in your world, then?"


Not really. It's fine for checking simple things like your character's position compared to the ground and where a bullet hits a surface. It's too slow for general purposes though because you'd have to check too many points simultaneously - in addition you'd have the problem of deciding which points to check. Standard box collision simplifies those checks considerably.



Powered by Free Banners
Derek Darkly
13
Years of Service
User Offline
Joined: 22nd Sep 2011
Location: Whats Our Vector, Victor?
Posted: 13th Jun 2015 19:07
Quote: "you'd have to check too many points simultaneously"


Hmm, I wonder if doing distance checks for each object and using INTERSECT OBJECT only for nearby objects would be efficient at all.

Oh well, I can't test it anyway. Some of my Windows DLLs have been corrupted due to a hard drive issue and now I can't find my installation CD.

Ghost Games
18
Years of Service
User Offline
Joined: 1st Aug 2007
Location:
Posted: 13th Jun 2015 21:05
2 pics of my terrain, Sarrak the dessert planet...
Ghost Games
18
Years of Service
User Offline
Joined: 1st Aug 2007
Location:
Posted: 13th Jun 2015 21:06
one more
Scorpyo
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: italy
Posted: 13th Jun 2015 23:49 Edited at: 13th Jun 2015 23:50
Quote: "
Hmm, I wonder if doing distance checks for each object and using INTERSECT OBJECT only for nearby objects would be efficient at all.
"


Actually, for simple enviroments I've been using such method a lot:
example:


My max has been collision check to 3-4000 trees and 100-150 objects with good results with a recent PC. (i7 8G ram).
I remember you could hit severe bottlenecks with older PCs
Derek Darkly
13
Years of Service
User Offline
Joined: 22nd Sep 2011
Location: Whats Our Vector, Victor?
Posted: 14th Jun 2015 17:12
Quote: "My max has been collision check to 3-4000 trees and 100-150 objects with good results with a recent PC"


Not bad!
I imagine that's useful for objects with abstract or complex shapes.

Derek Darkly
13
Years of Service
User Offline
Joined: 22nd Sep 2011
Location: Whats Our Vector, Victor?
Posted: 14th Jun 2015 17:18
Nice terrains, Ghost Games!
Dreamscape looks awesome.

Login to post a reply

Server time is: 2025-08-09 02:29:31
Your offset time is: 2025-08-09 02:29:31