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.

Newcomers DBPro Corner / Set Terrain Texture - can't get it to work

Author
Message
Kinetic
17
Years of Service
User Offline
Joined: 21st Sep 2007
Location:
Posted: 26th Jan 2010 04:43
I read about the undocumented "advanced terrain statements" in Hands on Darkbasic Volume 2. But I can't get it to work with textures, only basic one color polygons.

Basically this code snippet works:



However when trying to add textures the whole terrain becomes black...



Question 1: How do I successfully create and texture advanced terrain? What am I doing wrong above?

---

More testing:

I tried the following workaround and succesfully got it textured:



However when converting terrain into an object I son't know how to find the "terrain height".

Question 2: Is there any way to find the "terrain height" of a regular Dark Basic Object?

Question 3: Is there some way to create a matrix from a terrain or object? (Then I could use "get ground height" to get the height.

-Andrew

---

-Kinetic
Scorpyo
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: italy
Posted: 26th Jan 2010 20:17 Edited at: 26th Jan 2010 20:18
If you want a real Advanced Terrain example download the example in my reply here:

http://forum.thegamecreators.com/?m=forum_view&t=163836&b=7

to get the ground height, or any height of a terrain like mesh use intersect object :

x#=object position x(player):z#=object position z(player)
height#=10000-intersect object (object number,x#,10000,z#,x#,-10000,z#)

this casts a ray at player position from 10000 to - 10000 in height and gives you the surface height of "object number" at that point.
No need for underneath matrix.

cheers

Login to post a reply

Server time is: 2024-11-23 20:11:01
Your offset time is: 2024-11-23 20:11:01