POV-Ray : Newsgroups : povray.general : Rotation-Problem : Rotation-Problem Server Time
19 Nov 2024 09:38:27 EST (-0500)
  Rotation-Problem  
From: Martin Thoma
Date: 22 Mar 2002 10:12:04
Message: <3C9B4975.2ACCD898@radiok2r.de>
Hello!

I want to make a kind of a star: Some cylinders around a given point
which always points towards the point. I tried the following code, but
the cylinders are never pointing to the point (which is symolized by the
sphere). What am I doint wrong?

Martin

#include "colors.inc"
#include "transforms.inc"

camera
{       location < 0, 200, -800 > // 200, 200 / 400, 400
        direction < 0, 0, 2.836>
        up <0, 1, 0>
        right <800/600, 0, 0>
        look_at <0, 0, 0>
}

  background { color rgb < 1.000, 1.000, 1.000 >}

  light_source { <-200, 200, -1000> White }

  declare F = finish {phong 0.8 specular 1.0 roughness 0.001 ambient rgb
<0.3,0.3,0.3> }

#macro Test(xOff, yOff, zOff)
cylinder
{       <0, 30, 0>, <0, 0, 0>, 6
        texture { pigment { rgb <1.0,0.2,0.0> } finish{ F }}
        translate <xOff, yOff, zOff>
}
#end

// The point we are rotating from
sphere
  {     <-30, -30, 0>
        7
        texture { pigment { rgb <1.0,0.2,0.0> } finish{ F }}
  }

// The Cylinders
#declare a = 0;
#while (a <= 90)
union
{       Test(0, 0, 0)
        Rotate_Around_Trans(<0, 0, -a>, <-30, -30, 0>)
        #declare a = a + 90/6;
}
#end


Post a reply to this message

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