Internal angles

Software: Other

Avatar
Darcey, Moderator
Posted: 23 December 2011 12:14 AM   Total Posts: 209

Anyone got the equation for working out the angle for this?

http://www.mathopenref.com/flash/TrigAngle.swf

Trying to calculate a single equation to handle connecting points from 1 object to another.

I know the following values at any given time:

Object 1: A circular object
Object 1 x: 0
Object 1 y: 0

Object 2: A circular object
Object 2 x: Rotates but is known
Object 2 y: Rotates but is known
Object 2 Orbit radius: 100


I am attempting to place an object at the exact outer edge of object 1 to the exact outer edge of object 2 but need that angle to achieve this.

Anyone?

 

   

Avatar
Darcey, Moderator
Posted: 23 December 2011 01:25 PM   Total Posts: 209   [ # 1 ]

I overcomplicated it… why I don’t know lol… Probably what I get for doing these things late at night. It’s was very basic pythag… 

So no worries…

I overcomplicated the idea of things with:

1. Object 1, outer arc/circumference position (x & y) in 4 quardrants & 4 90 degree divisions, rotational value based over time + circumference

2. Object 2, outer arc/circumference position (x & y) in 4 quardrants & 4 90 degree divisions, directional value based on angle to point 1’s result.

3. The item is then generated between object 1s circumference x,y,z point (point1’s answer) and object 2s circumference x,y,z point (point 2’s answer)

Ended up with 8 if statements handling:
4 x equations for each quadrant (top left / top right / bl & br)
4 x equations for each 90 deg

D

   

John Brookes, Moderator
Posted: 23 December 2011 03:20 PM   Total Posts: 732   [ # 2 ]

Out of interest.
What is/was it you were trying to do?
And what was the answer ? wink

   

Avatar
Darcey, Moderator
Posted: 23 December 2011 05:38 PM   Total Posts: 209   [ # 3 ]

Was a DNA label hotspot kinda thing… I wanted to calculate things fully. Was going from a 2D to 3D in a seemless transition.

The 2D
So a hotspot (circle with a plus on it), and label pops out when hover
Which is joined by a line to a smaller circle.
XML Driven.

The 3D
Spherical representations of the larger and smaller 2D circles will fade in as the 2D fades out giving a nice transition, matching sizes and positions. Plane with 1 side arced around the sphere for the label due to alpha not being 1 (still working this part out, may need to blender it). Scene then kinda spins around and the 3D hotspot moves to new positions while menus and content are generated and animated.

I went of on quite a few tangents testing a few experiments, where I toyed with various math for stuff.


Answer was:

1. Take x,y of larger 2D round object work out x,y point for line to start from using it’s radius and note it’s angle.

2. Take x,y, of smaller 2D round object using equation for point on circumference as done in step 1, inverse this and it will give you the point to draw to on smaller circle.


In progress:

1. Transition of line from cube depth of 10 or something small into plane which fits the spherical objects perfectly so as not to be seen due to the not 100% alpha.

2. Dynamic xml driven texture, for colour material and TLF text to implemented onto the arc sided plane.


D

   

John Brookes, Moderator
Posted: 23 December 2011 07:00 PM   Total Posts: 732   [ # 4 ]

Probably still be missing the point (pun intended).

Just incase..

If you want the same point on concentric circles, just scale the vector

eg
var v1:Vector3D = new Vector3D(100, 100, 0); //your start point on circle or even sphere
var v2:Vector3D = v1.clone()
v2.scaleBy(50 / v1.length); //want same point on 50 radius circle or sphere

trace(v2) //position
trace(v2.length) //radius

   
   
‹‹ View3d problem

X

Away3D Forum

Member Login

Username

Password

Remember_me



X