Skip to main content
gamedev.net
🔒 Locked

Collision Detection

Started by dr_slash_uh Jul 12, 2004 at 10:37 PM 3 replies 800+ views
Original Post
dr_slash_uh
dr_slash_uh
I am taking my first shot at collision detection and everything seems OK. The question I was wondering is, during every frame, do I have to recalculate the Distance scalar for the plane each and every program. Or Do I just do that only during polygon creation. Thanks in advance. Robert
rohitgonsalves
rohitgonsalves
What I undrstood from your question is your objects are static.

If you want to display static objects without collision then
you can do collision detection at the creation time of polygon.
Better you adjust values for your objects once so that they will never collide.

But what if you have a room and one sphere is moving around the room and movement of that sphere is controlled by the user. at this moment you have to check out sphere to plane collision at each and every frame. that is mandatory.

MOV AL, 0x00MOV AL, ME
dr_slash_uh
dr_slash_uh
My polygons are static, and from you answer I only need to calculate the plane and distance when I construct the Polygon. Also, is it normal to use the plane for the normal of the polygon used in shading?
rohitgonsalves
rohitgonsalves
Exactly,

Normals are normals wherever they might be used.
Either in shading or collision detections.

Normals are the perpendicular vectors to your plane and
direction of normals are fixed depending on how you set your
vertices of polygon, clockwise or anticlockwise.
MOV AL, 0x00MOV AL, ME
dawidjoubert
dawidjoubert
The PlaneDistance
planeDistance = dot(planeOrigin,PlaneNormal) // Only at setup

but the distance from the center of the sphere to the plane is need to be done every frame
----------------------------http://djoubert.co.uk

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.