POV-Ray : Newsgroups : povray.newusers : out of date tutorials : Re: out of date tutorials Server Time
28 Jul 2024 14:26:56 EDT (-0400)
  Re: out of date tutorials  
From: Alain
Date: 13 Dec 2008 16:33:11
Message: <49442a17$1@news.povray.org>
Lace nous illumina en ce 2008-12-13 01:21 -->
>>
>> Was your code completely identical to the doc's code?  I ask because the order
>> of transformations is significant - applying the same transformations in a
>> different order *will not* yield the same result.  Rotations occur around the
>> 'universe' axes, not ones local to the shape.  For this reason, I find it
>> helpful to create an object around the origin, rotate it appropriately, then
>> translate it into place.
>>
>> Also, could you post the relevant code (particularly your camera setup if your
>> code was identical to the above).
>>
>> -Reactor
> 
> 
> Hi there Reactor,
> 
> Here is the above tutorial:
> torus {
>   3, 11
>   pigment { color Yellow }
>   scale <1.5,1,1>
>   rotate <-45,0,0>
>   translate <0,2,0>
> }
> 
> And here is my copy of the tutorial:
> 
> torus {
>   3, 2
>   pigment {
> granite //*as you can see I tweaked the pigment because using {color yellow}
> would not work*\\
>   scale <1,5,1> //*the 1.5 works just the same as 1*\\
>   rotate <-45,0,0>
>   translate <0,2,0>
> }
It's usualy beter to scale, THEN apply the pigment.
torus{3,2 scale{1,5,1}pigment{granite}
rotate<-45,0,0>translate 2*y}
> 
> }
> //*I used the tutorial camera settings*\\
> camera {
> location <2,5,-10>
> look_at <0,0,0>
> }
> //*My fiance from the POV groups says may there be light so I added more light
> than usual :)*\\
> light_source {
> <0,10,-10>
> color rgb <2.0,2.8,2.0>
> }
Very bright and slightly green.
> 
> Well this is what I did with the torus. In the tutorial the torus shape looks
> lopsided which is really cool but I don't understand why it isn't shaping out
> on my end. With the box and trying to rotate it on it's axis, I haven't done
> much to it yet but here is the code for that (I kept it just like the tutorial
> version for camera position):
> 
> camera {
>   location <2,5,-10>
>   look_at <0,0,0>
> }
> 
> 
> light_source {
>   <10,-10,-10>
>   color rgb <1.0,2.0,1.0>
> }
> 
> 
> box {
>   <0,0,0>, 3
>   pigment { color rgb <1.0,0.2,1.0> }
>   rotate <-45,0,0>
>   translate <0,2,0>
> }
> 
> I hope that you can help, it is much appreciated!
> Thanks,
> Lace
> 
> 
> 
> 
Your box have 1 corner at the origin, the other at <3,3,3>.
Any rotation and scaling will leave the corner at <0,0,0> in that exact same 
location.
If you want it to rotate around it's center, then:
box{-1.5,1.5 ... translate 3.5*y}
Will make a box of the same dimention centered around the origin, and now, the 
rotations are made around it's center.

-- 
Alain
-------------------------------------------------
You know you've been raytracing too long when you prefer bald romatic partners, 
because they're easier to model.
John VanSickle


Post a reply to this message

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