POV-Ray : Newsgroups : povray.general : Duplicate ? : Re: (exacly) - Duplicate ? Server Time
5 Aug 2024 04:19:40 EDT (-0400)
  Re: (exacly) - Duplicate ?  
From: Rafal 'Raf256' Maj
Date: 24 Nov 2002 13:04:54
Message: <Xns92D0C18A32116raf256com@204.213.191.226>
"Marc-Hendrik Bremer" <Mar### [at] t-onlinede> wrote in 
news:3de10ccd@news.povray.org

> 
> "Rafal 'Raf256' Maj" <raf### [at] raf256com> schrieb im Newsbeitrag
> news:Xns### [at] 204213191226...
>> So I suggest 2 future reguests to achive this :
>> 1. allow syntax
>> mesh {
>>   mesh { ... rotate ... translate ... } // leaf 1
>>   mesh { ... rotate ... translate ... } // leaf 2
>>   [...]
>>   rotate ... translate ...
>> } // grass block
> Why don't you just use a macro for this? Okay, you will end up, with one
> mesh with some thousands of triangles, but that should be no problem, as
> most meshes are much larger.

I do use macro :)

Exacly :

Macro PutGrass - generates single grass leaf (about 200-500 triangles).
It works as :
mesh {
  // loop {
    triangle { ... }
  // }
  translate ... rotate ... // ((-1-))
}


Macro PutGrassArea calls PutGrass in loop

Later, we have
#declare GrassBlock = union { // ((-2-))
  PutGrassArea(0,0,10,10)
}

The problem is, that I cann't change union to mesh in line ((-2-)) due to 
transforms in ((-1-))

In free time I will try to work-around, by either :
1. removing ((-1-)) and applying this transform to each wector of each 
triangle by hand (vrotate etc)
2. writting a C program that will generate grass for me (GrassBlock)

any other ideas ?

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

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