POV-Ray : Newsgroups : povray.general : Instancing Trees : Instancing Trees Server Time
30 Jul 2024 16:14:52 EDT (-0400)
  Instancing Trees  
From: slongay
Date: 15 Oct 2008 18:30:00
Message: <web.48f66e66381609d92ebc1c00@news.povray.org>
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

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.