Models in a random field ?

BlitzMax Forums/BlitzMax Beginners Area/Models in a random field ?

Yue(Posted 2016) [#1]





Hello , any suggestions to put models on a plot at random, without loading them manually?


Local columna:int  = xLoadMesh("Data\Modelos\Columna.b3d")
t# = xTerrainY( terreno\terreno%, xEntityX(columna%), xEntityY(columna%), xEntityZ(columna%)-20 )

xPositionEntity columna:int, 64*20, t#, 64*20
xScaleEntity columna:int, .5, .5, .5

Local columna2:int  = xLoadMesh("Data\Modelos\Columna.b3d")
xPositionEntity columna2:int, 64*20 +  Rnd( 100, 110 ) , t#, 64*20 
xScaleEntity columna2%, .5, .5, .5





Trinosis(Posted 2016) [#2]
Use object instancing.

Load one object, and use copyobject to make a copy of it for all the others.

In fact, you could create an object library in memory of all your unique objects and just copy them when needed.

Which is infact what i do in Blitz3d.

Much faster than loading them each time.