CodeBase - limps

Return to the CodeBase listing

Category: Complete Applications

Version: 1.0

0
0

Information

Uploaded: 29th Sep 2008 01:15

Modified: 1st Jan 1970 01:00

Author:  Zack V11

Summary

sync on rem make an object make object box 1,100,100,100 rem make a cylinder shaped object to get the mesh for the limb from rem (note that the mesh number comes before the object number on the make mesh from object command) make object cylinder 2,100 make mesh from object 1,2 delete object 2 rem add a limb to the box object using the mesh from the cylinder (obj number, limb number, mesh number) rem limbs must be created in sequence, 1,2,3,4 etc add limb 1,1,1 rem rotate the limb rotate limb 1,1,45,45,0 rem resize the limb scale limb 1,1,50,150,50 rem adjust the position of the limb offset limb 1,1,0,100,0 rem (set the object) set object 1,1,1,0,1,1,1,1 rem (setup camera) position camera 250,100,-500 rem loop do set text font "arial" ink rgb(500,500,500),0 center text 320,10,"use left and right arrow keys to rotate the cylinder limb" center text 320,460,"press escape to exit" rem rotate object yrotate object 1,wrapvalue(object angle y(1)+0.5) rem move object move object 1,2.5 rem rotate limb (limb angle x(obj number,limb number) if leftkey()=1 then rotate limb 1,1,wrapvalue(limb angle x(1,1)-1),45,0 if rightkey()=1 then rotate limb 1,1,wrapvalue(limb angle x(1,1)+1),45,0 sync loop

Full Description

sync on<br /> <br /> <br /> <br /> rem make an object<br /> make object box 1,100,100,100<br /> <br /> <br /> <br /> <br /> rem make a cylinder shaped object to get the mesh for the limb from<br /> rem (note that the mesh number comes before the object number on the make mesh from object command)<br /> make object cylinder 2,100<br /> make mesh from object 1,2<br /> delete object 2<br /> <br /> rem add a limb to the box object using the mesh from the cylinder (obj number, limb number, mesh number)<br /> rem limbs must be created in sequence, 1,2,3,4 etc<br /> add limb 1,1,1<br /> <br /> <br /> rem rotate the limb<br /> rotate limb 1,1,45,45,0<br /> <br /> rem resize the limb<br /> scale limb 1,1,50,150,50<br /> <br /> rem adjust the position of the limb<br /> offset limb 1,1,0,100,0<br /> <br /> <br /> <br /> <br /> <br /> <br /> rem (set the object)<br /> set object 1,1,1,0,1,1,1,1<br /> <br /> <br /> rem (setup camera)<br /> position camera 250,100,-500<br /> <br /> <br /> <br /> <br /> <br /> <br /> rem loop<br /> do<br /> <br /> set text font &quot;arial&quot;<br /> ink rgb(500,500,500),0<br /> center text 320,10,&quot;use left and right arrow keys to rotate the cylinder limb&quot;<br /> center text 320,460,&quot;press escape to exit&quot;<br /> <br /> rem rotate object<br /> yrotate object 1,wrapvalue(object angle y(1)+0.5)<br /> <br /> rem move object<br /> move object 1,2.5<br /> <br /> rem rotate limb (limb angle x(obj number,limb number)<br /> if leftkey()=1 then rotate limb 1,1,wrapvalue(limb angle x(1,1)-1),45,0<br /> if rightkey()=1 then rotate limb 1,1,wrapvalue(limb angle x(1,1)+1),45,0<br /> <br /> sync<br /> loop

Comments

No comments yet.