|
![](/i/fill.gif) |
Hi, I am trying to build a scene with many trees though many of the trees can be
the same just rotated or scaled slightly. My current setup is as follows
#declare leaf1 = mesh { smooth_triangle ... }
#declare leaf2 = mesh { smooth_triangle ... }
#declare tree = object { union {
mesh { triangles for a branch }
mesh { triangles for another branch}
.... // for all branches
object { object { object { leaf1 scale<x,y,z> } matrix ...} translate<x,y,z> }
object { object { object { leaf2 scale<x,y,z> } matrix ...} translate<x,y,z> }
.... // continues for all leaves
}
translate<x,y,z> // to place the base of the model at <0,0,0>
scale<x,y,z> // to adjust the size of the model
}
Then in my program I instance this tree object many times with
object { tree scale<x,y,z> rotate<x,y,z> translate<x,y,z> }
But this causes POV-ray to run out of memory very quickly so I don't think this
is instancing the geometry properly.
From reading the manual it says that mesh's can be instanced but is it because I
have a bunch of mesh's in a union that this does not work?
Is the only solution to this to make one massive mesh which has all branch
geometry and all leaf geometry inside it and then instance that?
Thanks
-Steve
Post a reply to this message
|
![](/i/fill.gif) |