Page 1 of 1

implementing Random Bitmaps

Posted: Fri May 23, 2008 2:32 pm
by jph_wacheski
This one took me a bit of experimentation to figure out, so I will share the results and save the rest of you all some time.

In order to have randomized Bitmaps per/Model you have to place the Bitmap component in the Model's Definitions,. HOWEVER you must also place the Material that uses the Bitmap in the Definitions as well ! If you are useing your oun random Value you would likely define that there as well. Attached is a small example to look at it in action.

This is a very powerfull feature of ZGE put it to good use.

Posted: Fri May 23, 2008 3:02 pm
by VilleK
The reason that the material must be inside the model is because when a model is spawned as a clone, the whole model and all child-components (and their internal references to each other) are fully cloned. If another component (outside the model) reference a child component to the model (like a material reference a bitmap) and the model is cloned, then the material will still reference the original bitmap (not the clone). Many words... but it is quite simple really :)

Thanks for sharing, jph.