POV-Ray : Newsgroups : povray.newusers : Why didn't this work? : Re: Why didn't this work? Server Time
5 Sep 2024 14:21:01 EDT (-0400)
  Re: Why didn't this work?  
From: Tom Melly
Date: 6 Jul 2000 10:07:47
Message: <396492b3@news.povray.org>
"CreeD" <mes### [at] nqinet> wrote in message
news:01bfe74e$2924b4c0$021ba1d0@mk...

> ... scaled object and it disappeared.

When you scale an object, all that POV does is to move all parts of the
object from their origin to their origin*scale.

If a point of your object is at <0,0,0>, then that point will stay at
<0,0,0>, since 0*anything = 0. However, if no point of your object rests on
<0,0,0>, then all bets are off.

For example:

sphere{<0,1,0>, 1 scale 2} // the bottom of the sphere will stay at <0,0,0>
since it was their to start with. The top of the sphere moves from y=2 to
y=4.

sphere{<0,1,0>, 0.5 scale 2} // the bottom of the sphere moves from y=0.5 to
y=1. The top of the sphere moves from y=1.5 to y=3

In general, make sure that all objects have a point at <0,0,0>, perform your
scaling and then translate. The general order for transformations is: scale,
rotate, translate. There will be many times when you will deliberately want
to break one or all of these rules, but only break them when you know why
you are breaking them. A good example would be creating the
minute-indicators around the edge of a clock. Then it makes sense to
translate first, rotate second.

To help me remember the order, I use my door rule. You open a door by first
SCALING your hand to the door-knob, then ROTATING the handle, and finally by
TRANSLATING the door.

The door rule is non-copywrited and may be modified and distributed without
restrictions. ;)


Post a reply to this message

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