# Camera rotation conversion to SWF MC Arrow - Macromedia Director 3D

We currently are working on a 3D Vis project. We have a DCR 3D world in a DIV within our web page. In another DIV we have our "Gods Eye" view. This was done in Flash and has a moving target box that shows your relative lateral positoin in the 3D world. We have this working. The problem is our directional arrow within this "Target Box". As we rotate in the 3D world, we are attempting to send the SWF a value in order to rotate the arrow in the relative position. The problem is that the 3D world has ...

1. ## Camera rotation conversion to SWF MC Arrow

We currently are working on a 3D Vis project. We have a DCR 3D world in a DIV
within our web page. In another DIV we have our "Gods Eye" view. This was done
in Flash and has a moving target box that shows your relative lateral positoin
in the 3D world. We have this working. The problem is our directional arrow
within this "Target Box". As we rotate in the 3D world, we are attempting to
send the SWF a value in order to rotate the arrow in the relative position. The
problem is that the 3D world has different rotation values then the flash. In
other words, if we are at 90 degrees in the 3D world the value of the SWF is 0.
The 3D world works in values of -0 to -180 and 0 - 180 where as the SWF works
on a 0-360 value. Can anyone help with the conversion of this so that we can
send the SWF the correct value? Thank you in advance.

delex_media Guest

2. ## Re: Camera rotation conversion to SWF MC Arrow

this is a problem when you simply want to get the angle in degrees form 0 to
360. but i think you should take a look at:

anglebetween
and xaxis, zaxis, yaxis

and here is some code that should work, did not tested it right now but take a
look at the idea:

grouprot=pMember.group("camgroup").transform.xaxis

if grouprot.z>0 then
theangle= grouprot.anglebetween(vector(1,0,0))
end if

if grouprot.z<0 then
theangle=( 360 - grouprot.anglebetween(vector(1,0,0)))
end if

hope it will work, the idea is to use a group that only does the y-rotation of
your objekt. so it will have all the time the y-axis as vector (0,1,0), than
you can use the zaxis to specifie on wich "side" you are at the moment.

hondo3000 Guest

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•