Jump to content

Recommended Posts

Posted
SetTerrainHeight

C: void SetTerrainHeight( TEntity terrain, long x, long y, flt height )

C++: void Terrain::SetHeight( int x, int y, flt height )

BlitzMax: SetTerrainHeight( terrain:TTerrain, x, y, height# )

Pascal: procedure SetTerrainHeight ( terrain:THandle; x:Integer; y:Integer; height:Single );

Sets the terrain height at the specified grid point. Height should be a number between 0 and 1.

 

How is a height between 0 and 1 of any use? Are all vertex heights in a terrain decimals are they?

Posted

I think it's internally a byte with values 0-255, but that would be difficult to use, so 0.0-1.0 is better.

Ryzen 9 RX 6800M ■ 16GB XF8 Windows 11 ■
Ultra ■ LE 2.53DWS 5.6  Reaper ■ C/C++ C# ■ Fortran 2008 ■ Story ■
■ Homepage: https://canardia.com ■

Posted

Internally, it's a word value (2 bytes). The real height is the terrain scale y component times the internal value, divided by 2^16. The GPU has a setting to treat the word as a 16-bit float.

Let's build cool stuff and have fun. :)

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...