POV-Ray : Newsgroups : povray.general : Ideas for POVRAY : Re: Ideas for POVRAY Server Time
31 Jul 2024 18:21:34 EDT (-0400)
  Re: Ideas for POVRAY  
From: JS
Date: 9 Nov 2006 19:20:00
Message: <web.4553c4b2edb96be9b84243450@news.povray.org>
Warp <war### [at] tagpovrayorg> wrote:
> JS <bos### [at] yahoocouk> wrote:
> > Reading the faq it's 'illegal' to post
> > code for POVRAY in this group
>
>   "Illegal" would mean that it's against the law of a country. Hardly.
>
>   Also, I don't see too much problem in posting short SDL examples here.
> For longer code it may be a better idea to set up a webpage and then post
> a link to it.
>
> --
>                                                           - Warp

Hi and thank you. Here is the coding in skeleton form for an arm:

#include "colors.inc"

camera {location <0,0,-6> look_at <0,0,0>}
light_source {<0,0,-20> color White}
background {color Blue}

#declare upparm_l=<0,-1.7,0>;       //Upperarm length
#declare forarm_l=<0,-2,0>;         //Forearm length

#declare shoulder=sphere {<0,0,0>,0.4 pigment {color Red} finish {phong 1}}
#declare upparm=cylinder {<0,0,0>,upparm_l,0.3 pigment {color Yellow} finish
{phong 1}}
#declare elbow=sphere {<0,0,0>,0.35 pigment {color Green} finish {phong 1}}
#declare forarm=cone {<0,0,0>,0.3,forarm_l,0.25 pigment {color Yellow}
finish {phong 1}}
#declare wrist=sphere {<0,0,0>,0.3 pigment {color White} finish {phong 1}}
#declare hand=sphere {<0,0,0>,0.5 scale <1,1.5,1> pigment {color Orange}
finish {phong 1} translate y*-0.7}

#declare upparm_r=<0,0,0>;          //Upperarm rotation (about shoulder)
#declare forarm_r=<0,0,0>;          //Forearm rotation (about elbow)
#declare hand_r=<0,0,0>;            //Hand rotation (about wrist)

union {
    object {shoulder}
    object {upparm rotate upparm_r}
    object {elbow translate upparm_l rotate upparm_r}
    object {forarm rotate forarm_r translate upparm_l rotate upparm_r}
    object {wrist translate forarm_l rotate forarm_r translate upparm_l
rotate upparm_r}
    object {hand rotate hand_r translate forarm_l rotate forarm_r translate
upparm_l rotate upparm_r}

    translate y*2.5
}

What do you think? Just change the rotation values (upparm_r, forarm_r, and
hand_r) and everything moves accordingly. Is this inverse or forward
kinematics, or have I got the whole idea wrong? Oh, and please excuse my
bad coding but I prefer to get something working first and then worry about
whether it's badly written or not.


Post a reply to this message

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