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.
implementing Random Bitmaps
Moderator: Moderators
- jph_wacheski
- Posts: 1005
- Joined: Sat Feb 16, 2008 8:10 pm
- Location: Canada
- Contact:
implementing Random Bitmaps
- Attachments
-
- random_bitmap_tests.zgeproj
- the project file example.
- (1.45 KiB) Downloaded 595 times
iterationGAMES.com
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.
Thanks for sharing, jph.