Original Post
I'm making a 3D game, and the objects need to be able to rotate. I want to rotate a vector on 3 different axes, with just 2 points and 3 angles (for each axis). currently, the code goes: (x1,y1,z1) and (x,y2,z2) are the two necessary coordinates for the box which is being tested. (ox1,oy1,oz1) et al are the vector representing the player's movement. the ck() function just does the detection with the 4 given values. o1 won't always be (0,0,0), further complicating matters I already have code that does similar things on just x and z axes with just 1 axis of rotation, but, being still in middle school, I haven't yet learned to understand the sin() and cos() function's uses. despite many google searches, the closest I could find was this thread on how to do it in 2d, but I screwed up trying to get the other rotations right.
int checkcollision (double ox1, double oy1, double oz1, double ox2,
double oy2, double oz2) {
int cx,cy,cz;
cx = ck(x1,x2,ox1,ox2);
cy = ck(y1,y2,oy1,oy2);
cz = ck(z1,z2,oz1,oz2);
if(cx+cy+cz==3){return 1;}
return 0;
}