POV-Ray : Newsgroups : povray.general : Rotation-Problem Server Time
7 Nov 2024 09:28:48 EST (-0500)
  Rotation-Problem (Message 1 to 2 of 2)  
From: Martin Thoma
Subject: Rotation-Problem
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

From: Warp
Subject: Re: Rotation-Problem
Date: 22 Mar 2002 11:23:31
Message: <3c9b5a82@news.povray.org>
Martin Thoma <mar### [at] radiok2rde> wrote:
>         Rotate_Around_Trans(<0, 0, -a>, <-30, -30, 0>)

  Perhaps it would be easier to use Reorient_Trans() or Point_At_Trans()
instead?

-- 
#macro N(D)#if(D>99)cylinder{M()#local D=div(D,104);M().5,2pigment{rgb M()}}
N(D)#end#end#macro M()<mod(D,13)-6mod(div(D,13)8)-3,10>#end blob{
N(11117333955)N(4254934330)N(3900569407)N(7382340)N(3358)N(970)}//  - Warp -


Post a reply to this message

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