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 / Help plz whith terrain object -Height, Depth

Author
Message
greenpavel
15
Years of Service
User Offline
Joined: 13th Jun 2011
Location:
Posted: 21st Jun 2011 05:29 Edited at: 26th Jun 2012 07:13
How to find -Height, Depth of terrain object.
I do myself simple 3d level editor with terrain object


translated translator yandex or google
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 21st Jun 2011 13:39
What's the question exactly? Your code already finds the height:



What do you mean by depth?

Do you mean the overall width, height and depth of the terrain? If so you can use the object size x() and object size z() functions to get the width and depth. It seems to be a bit more awkward to get the overall height - not sure why.
greenpavel
15
Years of Service
User Offline
Joined: 13th Jun 2011
Location:
Posted: 21st Jun 2011 15:06
You haven't correctly understood

And I haven't correctly expressed

How to find length and width?

Simply who thought already that knows

Didn't want to write the program itself

On determination at random

greenpavel
15
Years of Service
User Offline
Joined: 13th Jun 2011
Location:
Posted: 21st Jun 2011 15:24

may be this!? THX
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 21st Jun 2011 19:44
Quote: "You haven't correctly understood

And I haven't correctly expressed"


And I still don't understand what you want.

Quote: "How to find length and width?"


Length and width of what? If you mean the whole terrain then I've already told you.

What is your code snippet supposed to be telling me?

chafari
Valued Member
20
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 21st Jun 2011 22:36 Edited at: 21st Jun 2011 22:38
Hi there. I think our friend meant how to know the terrain bounds in order not to fall down when terrain ends..... Now I don´t remember if terrain has its center in the middle of the object or in 0,0,0 .... l´m out with my smartphone...when I go back home I´ll have a look.


Cheers

I'm not a grumpy grandpa
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 22nd Jun 2011 11:22
I didn't think of that possibility. I sometimes wish people would post their questions in their native language - then we could translate them in Google .

I'm not so sure what Google would make of some of our native "English" speakers though.

The default coordinates of the four corners of advanced terrain are

(x, z) = (0, 0), (width, 0), (0, depth) and (width, depth).

I think you'll find that the centre of the terrain is in fact it's middle.
greenpavel
15
Years of Service
User Offline
Joined: 13th Jun 2011
Location:
Posted: 22nd Jun 2011 14:00

Don't work whith object terrain.WHY?(no 3d model, Terrain)
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 22nd Jun 2011 23:34
What value are you using for IDTerrain? It needs to be the same value you specified in the make object terrain command.
chafari
Valued Member
20
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 23rd Jun 2011 02:18
Quote: "I sometimes wish people would post their questions in their native language - then we could translate them in Google "


Yes ... sometimes the translator makes a mess and confuse us more than help

I made some checks, and it works:



Cheers.

I'm not a grumpy grandpa
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 23rd Jun 2011 12:53
Quote: "I made some checks, and it works:"


Yes it does, but it's probably safer to add or subtract small amounts to make sure the object is just inside the terrain - otherwise you can get strange effects because of rounding errors in the calculations. I believe get terrain ground height() is one function that can be affected.

Quote: "Yes ... sometimes the translator makes a mess and confuse us more than help"


That's true unfortunately - especially if you are using technical terms.
chafari
Valued Member
20
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 23rd Jun 2011 13:46
Quote: "it's probably safer to add or subtract small amounts to make sure the object is just inside the terrain "



You're right ...it was just a example of how to stay constantly over the terrain....I probably should put more distance from the edges to ensure that the player doesn`t lose himself flirting around the limits of the map.

About the translator, I use it mainly with the French ,and often takes me out of trouble since it is much like Spanish and I can make a boob


Cheers.

I'm not a grumpy grandpa
greenpavel
15
Years of Service
User Offline
Joined: 13th Jun 2011
Location:
Posted: 24th Jun 2011 20:23

dont work!
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 25th Jun 2011 01:29
More details please.
Scorpyo
23
Years of Service
User Offline
Joined: 26th Aug 2002
Location: italy
Posted: 26th Jun 2011 10:54
Advanced terrain size in DBP units is given by the heightmap texture size in pixels multiplied by the terrain x and z scale ( the command is : set terrain scale terrainID,xscale,heightscale,zscale ).

i.e. if you have:

heightmap.bmp = 256x256 pixels
and
set terrain scale 1,10,10,10

your terrain will be 2560x2560 DBP units wide.

remark:
the heightmap bmp must be greyscale, 24 bit color depth.

cheers
chafari
Valued Member
20
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 26th Jun 2011 13:01
Quote: "remark:
the heightmap bmp must be greyscale, 24 bit color depth."


Not exact...the texture works with any colour
Your theory about the size is correct and you can use it if you want to know the real size of the terrain, but the example I showed
do the same just refering to object size.

Cheers.

I'm not a grumpy grandpa
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 27th Jun 2011 12:08
Quote: "Not exact...the texture works with any colour "


Not quite - AT only uses the red component. The other components are ignored. So it can be any any colour as long as the red component is correct.
chafari
Valued Member
20
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 27th Jun 2011 14:26 Edited at: 28th Jun 2011 03:10
Quote: "So it can be any any colour as long as the red component is correct"


You`r right...it can be purple, pink, blue, green,greyscale and many others


I never try to discredit Scorpyo`s comment (sorry Scorpyo if you got it so ) I just find it funny about the remark .

Cheers.

I'm not a grumpy grandpa
greenpavel
15
Years of Service
User Offline
Joined: 13th Jun 2011
Location:
Posted: 22nd Sep 2011 20:52
To create the landscape editor with a card a picture I and couldn't.

Login to post a reply

Server time is: 2026-07-10 23:33:13
Your offset time is: 2026-07-10 23:33:13