Hi,
I have a problem with CollisionTriangle, at first I going to show you the code:
Graphics3D 1024,768,32,1
SetBuffer BackBuffer()
Camera=CreateCamera()
MoveEntity camera,0,1000,0
CameraRange camera,1,10000
ball=LoadMesh("Ball.3ds")
RotateEntity ball,0,45,0
EntityRadius Ball,10
EntityType ball,1
parcours=LoadMesh("Bahn1.3ds")
EntityType parcours,2
While Not KeyHit(1)
Collisions 1,2,2,1
PointEntity camera,ball
MoveEntity ball,0,0,1
If EntityCollided(ball,2) Then
Vertex1=TriangleVertex(CollisionSurface(parcours,CountCollisions(parcours)),CollisionTriangle(parcours,CountCollisions(parcours)),1)
Vertex2=TriangleVertex(CollisionSurface(parcours,CountCollisions(parcours)),CollisionTriangle(parcours,CountCollisions(parcours)),2)
End If
RenderWorld
UpdateWorld
Flip 0
Wend
Ok, now I tell you my problem. I want to find the collided triangle of the parcours, but that is impossible because the ball collides with the parcours, not the parcours with the ball, so I can only find the collided triangle of the ball (do you know what I mean?). But how can I find the collided triangle of the parcours?
gratefully,
BlitzBasic303
I have a problem with CollisionTriangle, at first I going to show you the code:
Graphics3D 1024,768,32,1
SetBuffer BackBuffer()
Camera=CreateCamera()
MoveEntity camera,0,1000,0
CameraRange camera,1,10000
ball=LoadMesh("Ball.3ds")
RotateEntity ball,0,45,0
EntityRadius Ball,10
EntityType ball,1
parcours=LoadMesh("Bahn1.3ds")
EntityType parcours,2
While Not KeyHit(1)
Collisions 1,2,2,1
PointEntity camera,ball
MoveEntity ball,0,0,1
If EntityCollided(ball,2) Then
Vertex1=TriangleVertex(CollisionSurface(parcours,CountCollisions(parcours)),CollisionTriangle(parcours,CountCollisions(parcours)),1)
Vertex2=TriangleVertex(CollisionSurface(parcours,CountCollisions(parcours)),CollisionTriangle(parcours,CountCollisions(parcours)),2)
End If
RenderWorld
UpdateWorld
Flip 0
Wend
Ok, now I tell you my problem. I want to find the collided triangle of the parcours, but that is impossible because the ball collides with the parcours, not the parcours with the ball, so I can only find the collided triangle of the ball (do you know what I mean?). But how can I find the collided triangle of the parcours?
gratefully,
BlitzBasic303