Here is a new version using Vertex manipulation rather than offseting the limb
REM Project: OFFSET LIMB
REM Created: 2/11/2007 10:36:39 AM
REM
REM ***** Main Source File *****
REM
randomize timer()
phy start
rem phy set gravity 0,-9.8,0
phy set skin width 0.01
SET AMBIENT LIGHT 60
autocam off
SYNC ON : SYNC RATE 60
GLOBAL ScreenCenterX : ScreenCenterX = screen Width()/2
GLOBAL ScreenCenterY : ScreenCenterY = screen Height()/2
MyFloor = 1
Make object Box MyFloor, 10,1,10
position object Myfloor, 0,-.5,0
color object Myfloor, RGB(255,255,0)
Phy make rigid body static box MyFloor
Flipper = 2
Make object Box Flipper, 5.0,1,1
ShiftObjectBox( Flipper,2.5,0.0,0.0)
position object Flipper, 0,0.5,0
rem offset limb Flipper,0,2.5,0,0
Phy Make rigid body dynamic box Flipper
Phy set rigid body kinematic Flipper,1
Ball1 = 3
Make object sphere Ball1,1,16,16
position object Ball1, 4,1.5,0
Phy Make rigid body dynamic sphere Ball1
Ball2 = 4
Make object sphere Ball2,1,16,16
position object Ball2, 0,1.5,-1.0
Phy Make rigid body dynamic sphere Ball2
position camera 0, 1,5,-10
Point camera 0, 0,.5,0
Do
inc Yr#,
phy set rigid body kinematic rotation Flipper, 0, Yr#, 0
phy update
sync
Loop
function ShiftObjectBox( ObjectNumber, Xp#,Yp#,Zp#)
`A function to make a capsule object
lock vertexdata for limb ObjectNumber, 0, 1
for Vertex = 0 to get VertexData Vertex Count()
`Get the vertex's current position
xPosition# = get VertexData Position X( Vertex )
yPosition# = get VertexData Position Y( Vertex )
zPosition# = get VertexData Position Z( Vertex )
set VertexData Position Vertex, xPosition#+Xp#, yPosition# +Yp#, zPosition#+Zp#
next Vertex
unlock vertexdata
`Make the finished object
make mesh from object 5000, ObjectNumber `Save the capsule shaped mesh
delete object ObjectNumber `Delete the temporary object
make object ObjectNumber, 5000, 0 `Make a new object from the mesh
delete mesh 5000 `Delete the mesh
endfunction
System
PIV 2.8 MZ 512 Mem
FX 5600 256 mem