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.

AppGameKit Classic Chat / CreateObjectFromHeightmap documentation?

Author
Message
Carharttguy
7
Years of Service
User Offline
Joined: 8th Jul 2016
Location: Belgium
Posted: 23rd Jun 2018 15:15 Edited at: 23rd Jun 2018 15:16
Hello

The description on this page: https://www.appgamekit.com/documentation/Reference/3D/CreateObjectFromHeightMap.htm
Is just 'See other command', which other command?

Some time ago there was something about which pixels are read etc. Does anyone has the original documentation?

Thanks!
Bengismo
6
Years of Service
User Offline
Joined: 20th Nov 2017
Location: Yorkshire, England
Posted: 25th Jun 2018 14:43 Edited at: 25th Jun 2018 14:55
For some reason the original documentation for this function has been set to "See other command" ?

Original Description was something like this
Quote: "
Description:
Creates an object from a specified height map, useful for making terrain.

The image should be PNG 8-bit greyscale or RGB, if it is RGB then only the red channel is read. 16-bit greyscale
support may be added in future. The object will have a single UV channel with the range 0 to 1 mapped to the entire
terrain. If you wish to modify this then you can use SetObjectUVOffset() and SetObjectUVScale(), or use a
shader that multiplies the UV coordinates by a specified amount. A shader can also be used to create multiple UV
channels from this single channel by applying different scale factors to each. A smoothing value of 1 is recommended
to remove stepping artifacts, adjust as necessary. The split value lets you create multiple meshes which can improve
performance, as unseen meshes will not be drawn. The split value specifies how many meshes to create along each
edge, for example a split value of 5 will create 5x5 = 25 meshes in total. Unlike other objects collision data is
not generated by default on this object as it can consume a lot of memory, use SetObjectCollisionMode() if you
want to turn it on. For terrains greater than 1024x1024 this is not recommended on mobile devices, and you should
use GetObjectHeightmapHeight() instead if possible. Turning on physics for this object will use even more
memory and is not recommended on terrains greater than 1024x1024 on any platform.

Definition
integer CreateObjectFromHeightMap( szImageFile, width, height, length, smoothing, split )
CreateObjectFromHeightMap( objID, szImageFile, width, height, length, smoothing, split )

Parameters
objID - The ID of the object to create
szImageFile - The filename of the image to use as a height map, PNG preferred, also supports JPEG
width - The desired width of the new object in the X direction
height - The desired height of the new object in the Y direction
length - The desired length of the new object in the Z direction
smoothing - The amount of smoothing to apply to the height values, 0=none, 1=one pass, 2=two passes, etc
split - 1=single mesh, 2=four meshes, 3=nine meshes, 4=sixteen meshes, etc
"
Paul Johnston
TGC Developer
21
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 25th Jun 2018 16:01
Thanks, fixed for the next version
Bengismo
6
Years of Service
User Offline
Joined: 20th Nov 2017
Location: Yorkshire, England
Posted: 25th Jun 2018 22:42 Edited at: 25th Jun 2018 22:49
If someone is correcting online documentation, can you also get these ones too please?

GetVector3Add() - Description is wrong - should be addition of the 2 vectors passed in (not cross product)

GetVector3Multiply() - Description is wrong - should be multiplys the vectorID by the multiplier value and stores in the resultVec

SetCameraBounds() - Parameters - everything is described as the "left" value. Should be left,right, top, bottom etc??

SetSpriteShader - is currently in the 3D Section of help - Should it be in 2D?

SetShadowCascadeValues() - Description "i.e. casecade2 must be greater than cascade1"


Thanks!
Paul Johnston
TGC Developer
21
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 26th Jun 2018 14:59
Thanks, I have implemented those changes
Carharttguy
7
Years of Service
User Offline
Joined: 8th Jul 2016
Location: Belgium
Posted: 26th Jun 2018 15:11
Thanks Paul!
Bengismo
6
Years of Service
User Offline
Joined: 20th Nov 2017
Location: Yorkshire, England
Posted: 27th Jun 2018 15:50 Edited at: 27th Jun 2018 20:04
Thanks Paul for the corrections!

I expected SetSpriteShader() and LoadSpriteShader() to be in 2D documentation as they only apply to sprites but it's not really all that important where they are as they are correct.
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 29th Jun 2018 18:31
Quote: "I expected SetSpriteShader() and LoadSpriteShader() to be in 2D documentation as they only apply to sprites"

me too

One of the best things about the helpfile is it has command search which I regularly use
Even finding core commands theres no link from the list that ive noticed so I type in a
command I want to search that I know is in the core, Then click core for the list.

Im not complaining I think the help file is really good and having examples is great as I
often looks at the examples when I cant remember how a command works or if its new
to me. And updating all the examples etc is time consuming so not worried about the
ones that don't work because of now obsolete and changed commands.
fubar

Login to post a reply

Server time is: 2024-04-20 11:38:20
Your offset time is: 2024-04-20 11:38:20