|
|
In article <web.3fbd82efbdd378f4a5634560@news.povray.org>,
"Justin Smith" <t74### [at] yahoocom> wrote:
> I'm trying to use a mesh to generate a clump of grass. I'm having a problem
> because apparently I can't rotate the individual triangles within the mesh.
> I'll show the erroneous code I'm using, so you can see what I am trying to
> do:
...snip...
> I am using 500,000 of these clumps of grass in my scene, randomly placed. I
> could just keep the grassblade as the individual mesh and then use union to
> form the clump, but as I have so many, I think I need to be able to keep
> the whole clump as a single mesh to keep the number of objects down, right?
Right general idea...you need to have it a single mesh, so you can copy
it and have several objects that refer to the same object. However, you
can't apply transformations to individual mesh triangles as you can to
triangle objects. Someone already mentioned the vrotate() function, if
you have a more complex transformation, you might try the vtransform()
macro in transforms.inc. To keep things fairly organized, you might want
to make a macro to create transformed triangles:
#macro Triangle(PtA, PtB, PtC, Trans)
#local tmpFn = function {transform {Trans}};
triangle {
tmpFn(PtA.x, PtA.y, PtA.z),
tmpFn(PtB.x, PtB.y, PtB.z),
tmpFn(PtC.x, PtC.y, PtC.z),
}
#end
mesh {
...
Triangle(<.02,0,0>, <-.02,0,0>, <.018,1.2,0>,
transform {
rotate < rotationx,0,0>
rotate <0,rotationy,0>
}
}
(the transform{} block is necessary)
--
Christopher James Huff <cja### [at] earthlinknet>
http://home.earthlink.net/~cjameshuff/
POV-Ray TAG: chr### [at] tagpovrayorg
http://tag.povray.org/
Post a reply to this message
|
|