POV-Ray : Newsgroups : povray.newusers : unexpected scale results : Re: unexpected scale results Server Time
28 Jul 2024 18:22:49 EDT (-0400)
  Re: unexpected scale results  
From: Alain
Date: 8 Dec 2007 00:41:49
Message: <475a2e9d$1@news.povray.org>
jofg nous apporta ses lumieres en ce 2007/12/07 20:08:
> // This exercise is from the 2.2.7.1  Transformations, scale and translate
> section of
> // the PovRay tutorial,
> // but it seems to have returned unexpected results
> // can you render this? thanks

>     //// Please explain why these spheres where translated to a new location
> after being scaled, thanks
> 
> 
>     sphere { <12, 10, 10>,1 // draws sphere at this location, should be next to
> Orange
>       pigment { Yellow }
>       scale < 3,2,4 >      // squishes and strectches according to scale, but
> where did it go??
>       // comment this scale out, to see Yellow sphere
>            }
This sphere is now centered at <12*3, 10*2, 10*4> or <36, 20, 40>
> 
>     sphere { <10, 10, 10>,1
>       pigment { Red }
>       translate 4*x         // draws sphere at <14,10,10>, should be next to
> Yellow next to Orange
This sphere is now at <14,10,10>
>       scale <2,.4,.5>       // squishes and strectches according to scale, but
> where did it go??
>       // comment this scale out, to see Red sphere
It's location is now <28, 0.4, 0.5>
> 
>            }
> 
When you want to scale or rotate an object, it's always beter to define it at 
the origin (around <0,0,0>), scale oan/or rotate it, THEN translate to where you 
want it to apears.

All scalings and rotations are ALWAYS performed relative to the origin of the 
coordinate system. So, the location of any object NOT at the origin will also 
change. Scaling will move the object on a line passing by the origin. Rotations 
will make the object orbit the coresponding axis.

-- 
Alain
-------------------------------------------------
You know you've been raytracing too long when you keep a blacklist of people who 
ask questions about 3DFX products.
Alex McLeod a.k.a. Giant Robot Messiah


Post a reply to this message

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