Hi, I have been fiddling with the Newton examples and am sure that the dddCollision sample worked previously however now when I compile and run this file the ball drops throught the "ground" object. I am sure that I have note changed the code but here it is anyway
LOCAL dtime
LOCAL org[] // just a dummy
LOCAL force[]
X_LOADOBJ "ground.ddd", 0
LOADSPRITE "ground.bmp", 0
X_LOADOBJ "sphere.ddd", 1
DIM force[3]
// initialize Newton Engine
NewtonCreate()
// default material
NewtonMaterialSetDefaults( 1, .9, .2, .9, .9)
ball = NewtonCreateSphere(.8, .8, .8, org[])
// position ball
NewtonBodySetPosition(ball, 0,12,3)
// enable dynamics
NewtonConvexCollisionCalculateInertialMatrix(ball, 1)
// enable gravity for ball
NewtonBodySetForceAndTorqueCallback(ball)
NewtonBodySetGravity(ball,0,-9.81,0)
NewtonBodySetAutoFreeze(ball, FALSE)
// solid, static ground
ground = NewtonCreateDDD(0, 0)
WHILE TRUE
NewtonUpdate(GETTIMER(), 6)
force[0] = -MOUSEAXIS(0)*3
force[2] = -MOUSEAXIS(1)*3
NewtonBodyAddTorque(ball, force[])
X_MAKE3D 1,100, 45
X_CAMERA 20, 20, -10, 0,0,0
X_AMBIENT_LT 0, RGB(255,255,255)
X_SCALING .8, .8, .8
NewtonDrawBody(ball, 1,0)
X_SCALING 1,1,1
X_SETTEXTURE 0,-1
NewtonDrawBody(ground, 0,0)
SHOWSCREEN
WEND
Using version 5.322
Thanks
Matthew