Page 1 of 1

CollisionDetection on Sprite3Ds

Posted: Tue Jan 06, 2004 11:32 am
by Megaborsti
Hi,
does anyone know how to use CollisionDetection with rotatet (or zoomed) sprite3ds? (without displaying them on 2d-sprites and collisiondetect them?)
My problem is, that I want to move,zoom and rotate sprite3ds (when I move the mouse and/or use keyboard) and then collisiondetect them.
I know that I could display each sprite3d on a simple 2d sprite and then detect these 2d-sprites, but that way cost toooo much frames (the sprite are not very small and it should be pixelcollision).
Is there any way to detect the collision of sprite3ds directly?

Thanks in advance

Posted: Tue Jan 06, 2004 8:04 pm
by Megaborsti
ok,
I tried the slow way because I had no other idea :roll: , but it seems that it is not possible to render sprite3Ds to 2dsprites!? 8O
The following code shows the problem: Displaysprite3d() seems to render on the backbuffer instead of on the sprite.

Code: Select all


InitSprite()
InitSprite3D()
InitKeyboard()
OpenScreen(800,600,32,"Sprites")

CreateSprite(0,100,100,#pb_Sprite_texture)
StartDrawing(SpriteOutput(0))
  Box(0,0,100,100,RGB(255,0,0))
StopDrawing()
CreateSprite3D(0,0)
CreateSprite(1,200,200)

Repeat
  ExamineKeyboard()
  
  UseBuffer(1)
  DisplaySprite(0,0,0)
  Start3D()
    DisplaySprite3D(0,0,0,255)
  Stop3D()
  UseBuffer(-1)

  DisplaySprite(1,400,400)
  FlipBuffers()
Until KeyboardPushed(#pb_key_escape)
End

The UseBuffer()-procedure works with normal sprites but not with sprite3Ds. :cry:

That meens, I think, that there is absolutely no way to collisiondetect sprite3Ds (until someone finds another). :?

Help me!