POV-Ray : Newsgroups : povray.general : Duplicate ? : Re: Duplicate ? Server Time
5 Aug 2024 10:20:01 EDT (-0400)
  Re: Duplicate ?  
From: Tim Nikias
Date: 27 Nov 2002 03:06:58
Message: <3de47d22@news.povray.org>
I think the problem is that you're placing the triangles
in a mesh and rotating the mesh. Why not use vrotate
and rotate the edges, then place tons of triangles
into a mesh? I think it would be worth the effort it
you corrected this memory-consumptious technique
you're using. But that's just my 2 cents worth.

I've made a mesh-grass-macro myself. It creates a set
of 2D Arrays with vector-positions, which represent the
edge-data for a single grass-blade (of which several are
calculated). Then, these are loaded into a 3D Array and,
using vrotate and mutliplying with floats, changed in size
and orientation. After all that, the 3D Array is "parsed"
with a macro which places appropriate triangles, and
then this little bush of grass is saved to disk. In this manner,
I mostly create 20 blades, take a selection of 15 per bush,
and make 5 bushes = 5 meshes. Since they're base size
is a circle, I can just randomly rotate them around the
y-axis, place hundreds of them, and use little memory (though
tracing time goes up, but no wonder, with hundreds of
objects, eh?).

Regards,
Tim

--
Tim Nikias
Homepage: http://www.digitaltwilight.de/no_lights/index.html
Email: Tim### [at] gmxde

>   This can be made even easier if you put the data inside an array and
> then create the mesh from it. This avoids repetition of calling the macro
> and giving it the same transformation each time (you can call the macro
> only at one line inside a loop).
>
>   (Of course you will save a lot of space if you store the vertices and
> triangle indices separately, as in the mesh2 format, but that's another
> story.)
>


Post a reply to this message

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