|
![](/i/fill.gif) |
In article <web.4217a68c1eb30463d977fb9c0@news.povray.org>,
"Tjeiken" <nomail@nomail> wrote:
>>i'm working on a trebuchet, that i should have animated. The problem is,
>>that i gotta have a piece rotating around a centerpoint in a circle. I'm
>>going to use cos and sin functions to get the x and y coordinates like
>>this:
>>cos(A)*r=x
>>sin(A)*r=y
>>
>>A=angle r=radius
>>The problem is, that when i use it, either the POV-Ray, or my calculator are
>>calculating wrong - most likely POV-Ray. my .pov code looks like this:
>>----------------------------------
>>#include "woods.inc"
>>declare beam = box{<0,0,0><1,1,1>
>>texture{T_Wood20}
>>}
>>#declare ANGLE = 1; /*change this to 1,2,3 etc.*/
>>object{beam scale<1.9,35.56,1.27> translate<0,43,2.54> translate
>>x*cos(ANGLE)*-22.86 translate y*sin(ANGLE)*-22.86}
>>--------------------------------------------
>>For me, it just looks like the beam is jumping around, rather than following
>>a circular pattern, which it should do.
>>Hope you can help me.
>>-Tjeiken
yes use sind() and cosd() like this :
#macro sind(deg_angle) sin(radians(deg_angle)) #end
#macro cosd(deg_angle) cos(radians(deg_angle)) #end
#declare a = 30; // 30 degrees
#debug concat("\n sin(",str(a,0,0),") = ",str(sind(a),14,12))
#debug concat("\n cos(",str(a,0,0),") = ",str(cosd(a),14,12))
#debug "\n\n"
hope that help
Post a reply to this message
|
![](/i/fill.gif) |