STRING* leaf_string = "leaf.bmp"; //The leaf file, can be a plane mdl with alpha aswell
ENTITY* mdl_with_vertexes_only;
action face_camera()
{
while(1)
{
my.pan = camera.pan;
my.tilt = camera.tilt;
wait(1);
}
}
function Add_leaf_to_vertex(ENTITY* ent)
{
var i;
for (i = ent_vertices(ent); i > 0; i--) // repeat until all vertices are checked
{
VECTOR v;
vec_for_vertex(v, ent, i);
ent_create(leaf_string,v,face_camera);
}
}
action tree() // Assign this to the mdl file that is supposed to have only vertexes
{
mdl_with_vertexes_only = me;
Add_leaf_to_vertex(me);
}