for my little game demo I'm making I need to detect what kind of terrain the model is over. right now Im just making big invisible models and using the native collision detection. i was wondering if theres an easy way for me to make a B&W zone map and compare the models position to in order to trigger an event.
How are you creating / generating your level / terrain? Is it one big texture, or are you using polygons as well?
There are a bunch of different techniques you can use for this .. which one is best depends a little on your situation.
One approach would be to use your terrain as height-map, and determine whether you're "in the mud" based on that. But you might want something with more precision / that's more controllable.
K
Attachments
Yellow = not-in-mud, Red = in-mud. Graphics are just for debugging purposes / to visualize the height-map.
im using one giant sprite thats in the OnRender of the ground model.
ive got an ortho cam active and the ground model is 1 unit below everything else. its the only map/level in the demo and player movement will be constrained to its boundaries.
Alright, the simplest method is probably to "mask" the terrain types using different alpha values. Then on loading the bitmap, you copy the values into a 2D array so they can be read easily by the player(s). Attached is a basic example.