Math/Trig Question: Finding the length of two angled lines? (fun demo included)

Software: Away3D 4.x

Avatar
owntheweb, Jr. Member
Posted: 09 November 2012 02:00 AM   Total Posts: 32

Hey,
I didn’t see this as an “Away3D Support” question, but it’s using in a fun Away3D project as part of it.

How do I figure out the length of line A and B in this graph?
http://www.flickr.com/photos/8139783@N08/8167334250/

Solving this problem will help me make the following component work properly when it gets tilted:
http://www.christopherstevens.cc/sos/kiosk3/ (click and drag up and down)

See how it’s not working desirably in the link below when tilted. If you click and drag with the tilted axises, you get an awkward twist motion, worse at sharper angles:
http://www.christopherstevens.cc/sos/kiosk3b

The end result of this donated project will be a remote control kiosk for Science on a Sphere as seen here (when classes are not scheduled):
http://www.spacefoundation.org/media/photo-galleries/wonders-universe

Thanks for your assist in advance. I truly appreciate it. :D

   

Avatar
theMightyAtom, Sr. Member
Posted: 09 November 2012 07:43 AM   Total Posts: 669   [ # 1 ]

Mathematically, I would put each point into a matrix, and use appendRotation to effectively remove the tilt. This lets you specify a rotation point other than the origin.
Then use ordinary trig.

Practically, I wouldn’t bother doing that. I would put the globe into a another container, and manipulate that. So only the globe is tilted and not the “navigation container”.

Looks like a fun project smile

Good Luck!

   

Avatar
owntheweb, Jr. Member
Posted: 10 November 2012 06:05 PM   Total Posts: 32   [ # 2 ]

theMightyAtom,
Genius! I placed a MovieClip on the stage and rotated that with the tilt, doing the basic math around the angled MovieClip instead of the stage. Life is great now:
http://www.christopherstevens.cc/sos/kiosk3c

Thanks a ton for your help.

Moving forward!

   

Avatar
theMightyAtom, Sr. Member
Posted: 12 November 2012 08:37 AM   Total Posts: 669   [ # 3 ]

Thanks Own, always glad to be of assistance when I can, especially for educational projects. I’m trying to break into the museum market myself.

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X