General Category > General Anim8or Forum
WEEHEEEE oh, oh wait its dead, I thought it was dancing (CRE8OR NOTICE)
cooldude234:
Well I learned some more about C++ vector classes, and was able to work on some more of my model loader.
So now, I can officially load up wavefront .obj files.
There's still quite a bit that needs to finished, since it only allows quad faces (square faces), and doesn't support texture coordinates yet (which I've temporary replaced with setting the faces a random colour each) and is glitchy on its normals (but even for that, the lighting seems to react fine with it).
once I get everything working 100% in the .obj format, I make it so that it will load up anim8or files.
cooldude234:
SPACESHIP!
cooldude234:
Well I now have pixel perfect mouse input working using a opengl function call gluUnProject, which basically reverses the matrix (the algorithm for making everything 3D), and is able to translate the mouse's position on the screen, into a 3d position.
Now I did this twice once, close to the screen, once far from the screen, so I have two points. In order to get full ray casting to work with the mouse I need to get the angle in degrees.
So I'm in a bit of a need for help. Does anyone know how to get the angle of two points that are relevant to the world?
Meaning I have two points, and if you were to draw a line horizontally towards from one point to the other, and vertically for the other, the point of intersection would be the third point. Forming a right triangle. Here's a picture to help visualize what I mean.
Raxx:
If you know the distance between the points and the intersecting point,
sin=opp/hyp
cos=adj/hyp
tan=opp/adj
So Angle of Point #1= arctan(distance between point#2 and intersecting point / distance between point#1 and intersecting point)
cooldude234:
I tried that before, but it keeps yielding weird results. It must be something that I am doing...
Hmmmm, I'll have to take another look at it.
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version