slinga
Established Member
Hey all,
I have been playing around with the SGL library the last few days and I have a small demo game almost done. I'm doing an asteroids (12 player of course) clone.
Each player is represented by a single triangle. By following the SGL tutorials I was able to get the player to move, rotate etc. The problem I have now is how do I determine the location of all three vertices? I need this for collision detection.
I tried something like this:
POLYGON is of type PDATA. This approach sort of works, this information gives me the original values of the vertices, but not the new values.
How can I get the current values of the vertices? Basically, I need to know the last coordinates the polygon was displayed. Without them I cannot do collision detection...
I have been playing around with the SGL library the last few days and I have a small demo game almost done. I'm doing an asteroids (12 player of course) clone.
Each player is represented by a single triangle. By following the SGL tutorials I was able to get the player to move, rotate etc. The problem I have now is how do I determine the location of all three vertices? I need this for collision detection.
I tried something like this:
Code:
void dbgBlasteroid(blasteroid* someBlasteroid)
{
char temp[256];
FIXED a, b, c;
unsigned int i = 0;
a = someBlasteroid->pos[X];
b = someBlasteroid->pos[Y];
c = someBlasteroid->pos[Z];
slPrint(" ", slLocate(5,10));
slPrintFX(a, slLocate(10,5));
slPrintFX(b, slLocate(10,6));
slPrintFX(c, slLocate(10,7));
for(i = 0; i < someBlasteroid->polygon->nbPoint; i++)
{
slPrintFX(someBlasteroid->polygon->pntbl[i][0], slLocate(1,i+10));
slPrintFX(someBlasteroid->polygon->pntbl[i][1], slLocate(10,i+10));
slPrintFX(someBlasteroid->polygon->pntbl[i][2], slLocate(20,i+10));
//slPrintFX(someBlasteroid->polygon->pntbl[1], slLocate(10,i+10));
//slPrintFX(someBlasteroid->polygon->pntbl[2], slLocate(10,i+10));
}
}
How can I get the current values of the vertices? Basically, I need to know the last coordinates the polygon was displayed. Without them I cannot do collision detection...