Need help pushing objects

Blitz3D Forums/Blitz3D Programming/Need help pushing objects

Is this kind of what you're after?

Graphics3D 800,600,0,2


cam=CreateCamera()
PositionEntity cam,0,5,-20


sphere=CreateCone()
RotateMesh sphere,90,0,0
PositionEntity sphere,-5,0,0
EntityType sphere,1

cube=CreateCube()
EntityType cube,2


light=CreateLight()
PositionEntity light,-5,-5,-5
PointEntity light, cube


Collisions 1,2,3,2


While Not KeyHit(1)

If KeyDown(200) MoveEntity sphere,0,0,0.2
If KeyDown(208) MoveEntity sphere,0,0,-0.2
If KeyDown(203) TurnEntity sphere,0,3,0
If KeyDown(205) TurnEntity sphere,0,-3,0

If EntityCollided(sphere,2)
For n=1 To CountCollisions(sphere)
ent = CollisionEntity(sphere,n)
x#=CollisionNX(sphere,n)/10
y#=CollisionNY(sphere,n)/10
z#=CollisionNZ(sphere,n)/10

TranslateEntity ent,-x#,-y#,-z#
Next
EndIf

UpdateWorld
RenderWorld
Flip
Wend