POV-Ray : Newsgroups : povray.newusers : Problems declaring objects : Re: Problems declaring objects Server Time
30 Jul 2024 04:15:07 EDT (-0400)
  Re: Problems declaring objects  
From: Tim Nikias
Date: 15 Sep 2004 06:25:25
Message: <41481895@news.povray.org>
> If I do this:
> ===================================
> object { Reloj rotate y*115 translate <0, 0, 0> scale 0.5 }
> object { Puntos }
> object { Agulles }
> object { Cilindre }
> ==================================
> I thinks that is your idea, I can not see the other object on the correct
> place. If I do this:
> ====================================
> object { Reloj rotate y*115 scale 0.5 }
> object { Puntos scale 0.5 }
> object { Agulles scale 0.5 }
> object { Cilindre scale 0.5 }

Well, in your first example, you only scale Reloj, in your second example,
you scale all objects, which is just like you did before. Maybe you should
consult the Documentaion, Section 2.2.7 for some more information on
transformations.

The idea is simple: "translate" moves an object, "rotate" rotates an object
about the origin and the given axis', and "scale" scales/sizes an object in
relation to the origin (<0,0,0>). So, if an object is placed at <5,0,0> and
you scale it by .5, not only will the object's dimensions (e.g. its radius)
be sized down to half its original size, but the distance to the origin will
be sized down as well, thus placing the object at <2.5,0,0>.

Then, when you declare and union{} objects, they all get "glued" together,
so when you transform a union, all objects inside the union will get
transformed.

Now, if you want to scale an object's size, but not it's position, what do
you have to do? Let's say you've got a sphere at <5,0,0> and want to squish
it some along the x-axis, making it more disc-shaped. First, you'd have to
translate the sphere back to the origin, then you scale it, and then you
translate it back.

sphere{<5,0,0>,1
translate <-5,0,0>
scale <.25,1,1>
translate <5,0,0>
pigment{rgb 1}}

Now, for a sphere this is kinda pointless, as you could have placed it at
the origin from the beginning and thus save translating it back to the
origin:

sphere{<0,0,0>,1
scale <.25,1,1>
translate <5,0,0>
pigment{rgb 1}}

But that's the basic idea of how to transform objects. I don't know what
exactly you're after, but if you only want to scale certain parts of an
object, then only scale those, not the entire object.

Regards,
Tim

-- 
"Tim Nikias v2.0"
Homepage: <http://www.nolights.de>


Post a reply to this message

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