## how to convert ( 0, 0 , 1 ) to degrees plz

### how to convert ( 0, 0 , 1 ) to degrees plz

can anyone please tell me how can u convert the view
matrixs LOOK AT vector to degrees?

like when ( its pointing at ( 0.5, 0.5, 0.5 ) u knw its
45 degrees but how do u mathematically convert the 0.5 to
45 degrees

thanks a lot

### how to convert ( 0, 0 , 1 ) to degrees plz

Quote:>like when ( its pointing at ( 0.5, 0.5, 0.5 ) u knw its
>45 degrees but how do u mathematically convert the 0.5 to
>45 degrees

Are you familiar with trigonometry?
--
Direct3D Book http://www.xmission.com/~legalize/book/
izfree: Open source tools for Windows Installer
http://izfree.sourceforge.net

### how to convert ( 0, 0 , 1 ) to degrees plz

yes i am

just let me know the concept or whatever that can lead
somewhere

i used to know how u could do it but now i forgot ....

>-----Original Message-----

>>like when ( its pointing at ( 0.5, 0.5, 0.5 ) u knw its
>>45 degrees but how do u mathematically convert the 0.5
to
>>45 degrees

>Are you familiar with trigonometry?
>--
Wesley!
>  Direct3D Book http://www.xmission.com/~legalize/book/
>    izfree: Open source tools for Windows Installer
>            http://izfree.sourceforge.net
>.

### how to convert ( 0, 0 , 1 ) to degrees plz

Quote:>>Are you familiar with trigonometry?

>yes i am

Great, that will make things easier.  The identities you need are for
converting from polar coordinates to rectangular coordinates.

If you have a 2D point with cartesian coordinates <x,y>, then you
can convert the point to polar coordinates with a magnitude r and
angle theta with respect to the x axis:

r = sqrt(x*x + y*y)
theta = atan2(y, x)

^ y
|     + (x,y)
|    /
| r /
|  /
| /
|/ theta
+--------------> x

(You can also use the function atan(y/x), but atan2() handles the
signs properly to give the proper quadrant.)

To go from polar to rectangular coordinates:

x = r*cos(theta)
y = r*sin(theta)

(With a little algebraic manipulation and the identities:
tan(theta) = sin(theta)/cos(theta)
cos(theta)*cos(theta) + sin(theta)*sin(theta) = 1
you can solve backwards for r and theta given x and y.)

Things are similar for 3D points, except that now you have a
magnitude r and two angles theta and phi, where theta and phi are
angles with respect to two of the principal axes, usually the angle
of the point when projected into the xy and xz planes.

This discussion computes the angle of a point with respect to the
origin.  To find the relative angle between two points you can
apply a translation to make one of the points coincident to the
origin and use the same logic.

With vectors, we have dot and cross product operations that can also
be useful for computing angles.

For two vectors a and b,

a dot b = length(a)*length(b)*cos(theta)

where theta is the smallest angle between the two vectors.  This
works for 2-d and 3-d vectors.

length(a cross b) = length(a)*length(b)*sin(theta)

and again, theta is the smallest angle between the two vectors.

D3DX provides 2D and 3D vector classes with functions for dot and
cross products.
--
Direct3D Book http://www.xmission.com/~legalize/book/
izfree: Open source tools for Windows Installer
http://izfree.sourceforge.net

### how to convert ( 0, 0 , 1 ) to degrees plz

Rich,

Forgive me for my last post, I was totally wrong about you!!! SORRY!

T.

> >>Are you familiar with trigonometry?

> >yes i am

> Great, that will make things easier.  The identities you need are for
> converting from polar coordinates to rectangular coordinates.

> If you have a 2D point with cartesian coordinates <x,y>, then you
> can convert the point to polar coordinates with a magnitude r and
> angle theta with respect to the x axis:

>     r = sqrt(x*x + y*y)
>     theta = atan2(y, x)

>     ^ y
>     |     + (x,y)
>     |    /
>     | r /
>     |  /
>     | /
>     |/ theta
>     +--------------> x

> (You can also use the function atan(y/x), but atan2() handles the
> signs properly to give the proper quadrant.)

> To go from polar to rectangular coordinates:

>     x = r*cos(theta)
>     y = r*sin(theta)

> (With a little algebraic manipulation and the identities:
>     tan(theta) = sin(theta)/cos(theta)
>     cos(theta)*cos(theta) + sin(theta)*sin(theta) = 1
> you can solve backwards for r and theta given x and y.)

> Things are similar for 3D points, except that now you have a
> magnitude r and two angles theta and phi, where theta and phi are
> angles with respect to two of the principal axes, usually the angle
> of the point when projected into the xy and xz planes.

> This discussion computes the angle of a point with respect to the
> origin.  To find the relative angle between two points you can
> apply a translation to make one of the points coincident to the
> origin and use the same logic.

> With vectors, we have dot and cross product operations that can also
> be useful for computing angles.

> For two vectors a and b,

>     a dot b = length(a)*length(b)*cos(theta)

> where theta is the smallest angle between the two vectors.  This
> works for 2-d and 3-d vectors.

>     length(a cross b) = length(a)*length(b)*sin(theta)

> and again, theta is the smallest angle between the two vectors.

> D3DX provides 2D and 3D vector classes with functions for dot and
> cross products.
> --
>   Direct3D Book http://www.xmission.com/~legalize/book/
>     izfree: Open source tools for Windows Installer
>             http://izfree.sourceforge.net

### how to convert ( 0, 0 , 1 ) to degrees plz

John,

You can forget getting any answer from the bozo who replied earlier. He's on
some kind of self-appointed pedestal. If you look, you'll notice he responds
to almost every post, but doesn't come close to actually answering the
question much solving the problem. So hopefully if you ignore him, he'll
just go away.

go the other way, given latitude and longitude values you can convert those
to Eye, Up vectors for "look at" type things:

LAT & LON are always computed first by converting degrees to radians...

m_fLat = (ANGLE1 * (PI / 180));
m_fLong = (ANGLE2 * (PI / 180));

Now, given those two values you can compute the following:

m_fEyeX = cos(m_fLat)*sin(m_fLong);
m_fEyeY = sin(m_fLat);
m_fEyeZ = cos(m_fLat)*cos(m_fLong);

m_fUpX = -sin(m_fLat)*sin(m_fLong);
m_fUpY = cos(m_fLat);
m_fUpZ = -sin(m_fLat)*cos(m_fLong);

Given that you can now use Eye and Up for camera orientations...

LookAt( m_fEyeX, m_fEyeY, m_fEyeZ,
0.0, 0.0, 0.0,
m_fUpX, m_fUpY, m_fUpZ );

This will point your camera at the origin ( 0, 0, 0).

Note: You may also have to do some translating depending on where you want

Hope this helps.

T.

> yes i am

> just let me know the concept or whatever that can lead
> somewhere

> i used to know how u could do it but now i forgot ....

> >-----Original Message-----

> >>like when ( its pointing at ( 0.5, 0.5, 0.5 ) u knw its
> >>45 degrees but how do u mathematically convert the 0.5
> to
> >>45 degrees

> >Are you familiar with trigonometry?
> >--
> Wesley!
> >  Direct3D Book http://www.xmission.com/~legalize/book/
> >    izfree: Open source tools for Windows Installer
> >            http://izfree.sourceforge.net
> >.

### how to convert ( 0, 0 , 1 ) to degrees plz

Quote:> John,

> You can forget getting any answer from the bozo who replied earlier. He's
on
> some kind of self-appointed pedestal. If you look, you'll notice he
responds
> to almost every post, but doesn't come close to actually answering the
> question much solving the problem.

Considering Rich is probably the most useful person on this board...although
he won't hold your hand or think for you.

The original post is off topic anyways.  Try a math newsgropu or
comp.graphics.algorithms.

### how to convert ( 0, 0 , 1 ) to degrees plz

Quote:> Considering Rich is probably the most useful person on this
board...although
> he won't hold your hand or think for you.

Right on, couldn't have said it better myself!

--
Eric DeBrosse
http://www.blown.com/dx/
Microsoft Visual Basic DirectX MVP

The opinions expressed in this message are my own personal views and
do not reflect the official views of Microsoft Corporation. The MVP program
does not constitute employment or contractual obligation with Microsoft.

any of you guys able to successfully import a model from poser to lightwave
and then add bones to it??(yeah-i know....using poser.....im just too lazy)
any help would be appreciated
Ash
=============<^>=============