POV-Ray : Newsgroups : povray.general : Duplicate ? Server Time
5 Aug 2024 10:24:04 EDT (-0400)
  Duplicate ? (Message 21 to 26 of 26)  
<<< Previous 10 Messages Goto Initial 10 Messages
From: Rafal 'Raf256' Maj
Subject: Re: Duplicate ?
Date: 25 Nov 2002 10:48:51
Message: <Xns92D1AA7C8FFB5raf256com@204.213.191.226>
Warp <war### [at] tagpovrayorg> wrote in news:3de23b63@news.povray.org

> Rafal 'Raf256' Maj <raf### [at] raf256com> wrote:
>> ...and copy of mesh[1] for each loop-pass (100*100 copies in RAM).
>   10000 copies does not sound like extremely memory-intensive.
>   How much memory does one copy need? Even if it required, let's say,
[...]

look at p.b.i - Trees[WIP] uses about 800 MB memoty while rendering (no 
radiosity/photons), without grass same scene uses about 50 MB


> and make less copies. If you, for example, make the mesh patch twice as
> large in both axes and then make 50*50 copies, that's only 2500 copies

I will try but IMHO size of boxes wan't change anything while 1 path is NOT 
a mesh, only 1 grass pice is a mesh.
So grass-field always has same number of mashes, both :
1000*1000 pathes = 1000*1000 *  10* 10 meshes
 100* 100 pathes =  100* 100 * 100*100 meshes

It WOULD be ony i.e. 100*100 MESHES if only syntax 
mesh {
  mesh { ... }
  mesh { ... }
  transform
}

would be allowed - as explained in other posts

-- 
#macro g(U,V)(.4*abs(sin(9*sqrt(pow(x-U,2)+pow(y-V,2))))*pow(1-min(1,(sqrt(
pow(x-U,2)+pow(y-V,2))*.3)),2)+.9)#end#macro p(c)#if(c>1)#local l=mod(c,100
);g(2*div(l,10)-8,2*mod(l,10)-8)*p(div(c,100))#else 1#end#end light_source{
y 2}sphere{z*20 9pigment{function{p(26252423)*p(36455644)*p(66656463)}}}//M


Post a reply to this message

From: Christopher James Huff
Subject: Re: Duplicate ?
Date: 25 Nov 2002 12:20:33
Message: <chrishuff-A7C9ED.12180425112002@netplex.aussie.org>
In article <Xns### [at] 204213191226>,
 "Rafal 'Raf256' Maj" <raf### [at] raf256com> wrote:

> I will try but IMHO size of boxes wan't change anything while 1 path is NOT 
> a mesh, only 1 grass pice is a mesh.

Well, as you have already been told, make each patch a mesh. It doesn't 
require any patching or new features, you just need to construct things 
a little differently.

-- 
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

From: Rafal 'Raf256' Maj
Subject: Re: Duplicate ?
Date: 25 Nov 2002 12:45:51
Message: <Xns92D1BE53324FBraf256com@204.213.191.226>
Christopher James Huff <chr### [at] maccom> wrote in
news:chr### [at] netplexaussieorg 

as I alread told, I know it, but it needs quite un-comfortable work around.
I must repleace

union {
  //...
  mesh {triangle{a,b,c} triangle{d,e,f} triangle{g,h,i} rotate A }
  //...
  mesh {triangle{a,b,c} triangle{d,e,f} triangle{g,h,i} rotate B }
  //...
  mesh {triangle{a,b,c} triangle{d,e,f} triangle{g,h,i} rotate C }
  rotate X
}

with

mesh {  
  //...
  triangle{vrotate(a,A),vrotate(b,A),vrotate(c,A)}
  triangle{vrotate(d,A),vrotate(e,A),vrotate(f,A)}
  triangle{vrotate(g,A),vrotate(h,A),vrotate(i,A)}
  //...
  triangle{vrotate(a,B)//.....
  triangle{vrotate(d,B)//.....
  triangle{vrotate(g,B)//.....
  //...
  triangle{vrotate(a,C)//.....
  triangle{vrotate(d,C)//.....
  triangle{vrotate(g,C)//.....
  rotate X
}

not to mention scale and translate in every triangel.

I hnow this is possible, but I suggest to make it more comfortable.



-- 
#macro g(U,V)(.4*abs(sin(9*sqrt(pow(x-U,2)+pow(y-V,2))))*pow(1-min(1,(sqrt(
pow(x-U,2)+pow(y-V,2))*.3)),2)+.9)#end#macro p(c)#if(c>1)#local l=mod(c,100
);g(2*div(l,10)-8,2*mod(l,10)-8)*p(div(c,100))#else 1#end#end light_source{
y 2}sphere{z*20 9pigment{function{p(26252423)*p(36455644)*p(66656463)}}}//M


Post a reply to this message

From: Christopher James Huff
Subject: Re: Duplicate ?
Date: 25 Nov 2002 13:26:49
Message: <chrishuff-BCD637.13242125112002@netplex.aussie.org>
In article <Xns### [at] 204213191226>,
 "Rafal 'Raf256' Maj" <raf### [at] raf256com> wrote:

> as I alread told, I know it, but it needs quite un-comfortable work around.
> I must repleace

A simple macro would make things easier:

#macro Tri(PA, PB, PC, Trans)
    #local TransFn = function {transform {Trans}}
    triangle {
        TransFn(PA.x, PA.y, PA.z),
        TransFn(PB.x, PB.y, PB.z),
        TransFn(PC.x, PC.y, PC.z)
    }
#end

mesh {
    #declare BladeTrans = transform {...}
    Tri(A, B, C, BladeTrans)
    Tri(A, B, C, BladeTrans)
    Tri(A, B, C, BladeTrans)
...
}

Again, no need for a new feature, you just don't know how to use the 
existing features properly.

-- 
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

From: Warp
Subject: Re: Duplicate ?
Date: 26 Nov 2002 04:28:03
Message: <3de33ea3@news.povray.org>
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.)

-- 
#macro N(D)#if(D>99)cylinder{M()#local D=div(D,104);M().5,2pigment{rgb M()}}
N(D)#end#end#macro M()<mod(D,13)-6mod(div(D,13)8)-3,10>#end blob{
N(11117333955)N(4254934330)N(3900569407)N(7382340)N(3358)N(970)}//  - Warp -


Post a reply to this message

From: Tim Nikias
Subject: Re: Duplicate ?
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

<<< Previous 10 Messages Goto Initial 10 Messages

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