POV-Ray : Newsgroups : povray.general : Hierarchy in POV-Ray ? Server Time
23 Dec 2024 22:35:36 EST (-0500)
  Hierarchy in POV-Ray ? (Message 1 to 9 of 9)  
From: Oodini
Subject: Hierarchy in POV-Ray ?
Date: 1 Jul 2003 18:32:34
Message: <3F020CFD.5080606@free.Fr>
Hello,

Does POV-Ray support hierarchy of objects ?

I don't find anything about that in the doc.

Thanks.


Post a reply to this message

From: Oodini
Subject: Re: Hierarchy in POV-Ray ?
Date: 1 Jul 2003 18:47:45
Message: <3F02108C.4050205@free.Fr>
> Does POV-Ray support hierarchy of objects ?
> 
> I don't find anything about that in the doc.

If you suggest me Union, where is the new centroid ?


Post a reply to this message

From: Christopher James Huff
Subject: Re: Hierarchy in POV-Ray ?
Date: 1 Jul 2003 20:01:30
Message: <cjameshuff-599B0C.19004901072003@netplex.aussie.org>
In article <3F0### [at] freeFr>, Oodini <svd### [at] freeFr> wrote:

> > Does POV-Ray support hierarchy of objects ?
> > 
> > I don't find anything about that in the doc.

    You'll have to be a little more descriptive with your 
questions...what kind of heirarchy are you thinking of? Nested unions 
can give you a hierarchical way of handling transformations and 
textures, is that what you meant?
    I kind of doubt you are asking about the bounding heirarchies used 
for optimization, but if you are, POV does support it. There is an 
automatically generated bounding heirarchy for all finite objects, and 
some objects such as blobs, meshes, and height fields support their own 
internal heirarchies.


> If you suggest me Union, where is the new centroid ?

    That would depend on the objects you are using. POV doesn't know and 
doesn't care. There are several ways you could define it, the method you 
use depends in part on what you're going to use it for. I have a hunch 
that you think transformations have something to do with the centroid of 
an object...this is not the case, all transformations are relative to 
the origin: < 0, 0, 0>

-- 
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: Mike Williams
Subject: Re: Hierarchy in POV-Ray ?
Date: 1 Jul 2003 21:16:33
Message: <81MTTBANAjA$Ewwq@econym.demon.co.uk>
Wasn't it Oodini who wrote:
>> Does POV-Ray support hierarchy of objects ?
>> 
>> I don't find anything about that in the doc.
>
>If you suggest me Union, where is the new centroid ?

Whatever technique you use to determine the centroid of the parts will
presumably still work for the centroid of the union.

-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

From: Oodini
Subject: Re: Hierarchy in POV-Ray ?
Date: 1 Jul 2003 21:57:53
Message: <3F023D19.9010107@free.Fr>
>>>Does POV-Ray support hierarchy of objects ?
>>>
>>>I don't find anything about that in the doc.
>>
> 
>     You'll have to be a little more descriptive with your 
> questions...what kind of heirarchy are you thinking of? Nested unions 
> can give you a hierarchical way of handling transformations and 
> textures, is that what you meant?

I mean a parent-child relationship, as in VRML.
If I move the parent, the child moves too.
If I rotate the child, it turns around the parent.

>     I kind of doubt you are asking about the bounding heirarchies used 
> for optimization, but if you are, POV does support it. There is an 
> automatically generated bounding heirarchy for all finite objects, and 
> some objects such as blobs, meshes, and height fields support their own 
> internal heirarchies.

Are you talking about what I just described ??

>>If you suggest me Union, where is the new centroid ?
> 
>     That would depend on the objects you are using. POV doesn't know and 
> doesn't care. There are several ways you could define it, the method you 
> use depends in part on what you're going to use it for. I have a hunch 
> that you think transformations have something to do with the centroid of 
> an object...this is not the case, all transformations are relative to 
> the origin: < 0, 0, 0>

I did think the centroid have something to do with transformations.
I meant that the transformations are supposed to be relative this point 
(at least for me :-) )

Actually, I am doing a renderer for a school project, and I intended to 
use basic POV files as input files. As I implemented a tree structure 
for objects (geometry, cameras...), I was wondering if POV does use this 
system.


Post a reply to this message

From: Oodini
Subject: Re: Hierarchy in POV-Ray ?
Date: 1 Jul 2003 22:01:30
Message: <3F023DF2.1030605@free.Fr>
>>>Does POV-Ray support hierarchy of objects ?
>>>
>>>I don't find anything about that in the doc.
>>
>>If you suggest me Union, where is the new centroid ?
> 
> 
> Whatever technique you use to determine the centroid of the parts will
> presumably still work for the centroid of the union.

Well, suppose I want to do a solar system. All the planets are supposed 
to turn around the sun (don't care about spin), and follow it when the 
sun turns around the center of the galaxy.
I mean thiskind of hierarchy.

But there isn't any hierarchy in the union, I guess.
All the objects are equal.


Post a reply to this message

From: Francois Labreque
Subject: Re: Hierarchy in POV-Ray ?
Date: 1 Jul 2003 23:02:03
Message: <3f024b2b$1@news.povray.org>
Program ended abnormally on 2003-07-01 22:05, Due to a catastrophic
Oodini error:

>>>> Does POV-Ray support hierarchy of objects ?
>>>>
>>>> I don't find anything about that in the doc.
>>>
>>>
>>> If you suggest me Union, where is the new centroid ?
>>
>>
>>
>> Whatever technique you use to determine the centroid of the parts will
>> presumably still work for the centroid of the union.
> 
> 
> Well, suppose I want to do a solar system. All the planets are supposed 
> to turn around the sun (don't care about spin), and follow it when the 
> sun turns around the center of the galaxy.
> I mean thiskind of hierarchy.
> 
> But there isn't any hierarchy in the union, I guess.
> All the objects are equal.

I think the answer you're looking for, is yes.  Relative position of objects in 
a union are kept when the transformation is applied to the whole union.

-- 
/*Francois Labreque*/#local a=x+y;#local b=x+a;#local c=a+b;#macro P(F//
/*    flabreque    */L)polygon{5,F,F+z,L+z,L,F pigment{rgb 9}}#end union
/*        @        */{P(0,a)P(a,b)P(b,c)P(2*a,2*b)P(2*b,b+c)P(b+c,<2,3>)
/*   videotron.ca  */}camera{orthographic location<6,1.25,-6>look_at a }


Post a reply to this message

From: ABX
Subject: Re: Hierarchy in POV-Ray ?
Date: 2 Jul 2003 02:28:50
Message: <jau4gv4qra1qp9v6dqd70fu4f5o67vfqaj@4ax.com>
On Wed, 02 Jul 2003 04:05:38 +0200, Oodini <svd### [at] freeFr> wrote:
> Well, suppose I want to do a solar system. All the planets are supposed 
> to turn around the sun (don't care about spin), and follow it when the 
> sun turns around the center of the galaxy.
> I mean thiskind of hierarchy.

Probably your question starts from misunderstanding that you can't create
object, then create orher object, then describe relation, then apply various
transformation selectively to various elements. But what are you looking for is
probably system like

#declare Earth_Globe=sphere{...};
#declare Moon_Globe=sphere{...};
#declare Earth_System=union{
                            object{Earth_Globe}
                            object{Moon_Globe transform{ ... }}
                           };
#declare Sun_Globe=sphere{...};
#declare Sun_System=union{
                          object{Sun_Globe}
                          object{Venus_System transform{ ... }}
                          object{Earth_System transform{ ... }}
                          object{Mars_System transform{ ... }}
                         }
#declare MilkyWay=union{
                        object{Sun_System transform{ ... }}
                        object{...}
                  }

ABX


Post a reply to this message

From: Warp
Subject: Re: Hierarchy in POV-Ray ?
Date: 2 Jul 2003 10:02:36
Message: <3f02e5fc@news.povray.org>
Oodini <svd### [at] freefr> wrote:
> But there isn't any hierarchy in the union, I guess.
> All the objects are equal.

  Wrong.

union
{ object { Object1 }
  union // sub
  { object { SubObject1 }
    object { SubObject2 }
    union // subsub
    { object { SubSubObject 1 }
      object { SubSubObject 2 translate y /*this affects only this object*/}
      translate -y // this affects all objects in this 'subsub' union
    }
    translate x // this affects all objects in this 'sub' union
  }
  translate z // this affects all the objects
}

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

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