General Category > General Anim8or Forum
WEEHEEEE oh, oh wait its dead, I thought it was dancing (CRE8OR NOTICE)
cooldude234:
Should I mention that these points are in 3d space.
I was just just calculating 2 triangles one for the x and z (yaw), and one for the x and y (pitch).
Would that cause some issue with this equation?
Raxx:
It seems like it'd work but I don't have much experience with 3D/vector math and such, at least not yet.
I'd assume that there are several libraries out there with functions that automatically calculate these kinds of things, and websites with info on this kind of math.
cooldude234:
Yea, I don't have much experience with 3d vectors.
I've done what I'm trying to do now with 2d along time ago and got it to work flawlessly.
I only recently started programming with 3D only at the start of summer. So I'm assuming that it must be something either that I'm doing, or something to do with the fact that it is 3D, or both.
cooldude234:
Well I solved one issue, still getting weird results, but however it seems that when I used the atan funtion (arctan), with the distances between two points etc etc. It was actually returning the value in radians, so I multiplied by 180 and divided by pi to convert it into degrees and now I'm getting the correct angle that the mouse is pointing.
Though my issue now I believe is just a matter of my programming, cause the ray is being projected correctly on the angles Yaw 0.
Water Music:
I've studied 3d calc and 3d physics a few years back, so I can probably dig up an answer for you, but I think I will need to know more details about what you are trying to do and what numbers you want to end up with. The problem could be a few things. Are you using lines or vectors? Is distance important or just relative orientation? The world, the camera, and the objects all have their own coordinate system, so which angle is being compared to which? E.G. "line between camera and its focal point in relation to the world's z-axis." And of course, a Google search for "angle between two 3d lines/vectors" will tell you more than I ever could on the subject.
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version