I am playing around with increasing and decreasing objects distance form origin while maintaining angle of departure. I split a sphere into peaces and want the pieces to increase and decrease their distance from origin. However I have never been a math wiz so I am having a hard time raping my head around the math. Anyone have any ideas of equation I should look at for this or does away already have a function to implement this?
thanks for any Ideas : )
Increasing distance from originSoftware: Away3D 4.x |
||
maddog, Sr. Member
Posted: 22 October 2011 07:09 PM Total Posts: 118 |
||
Somokon, Member
Posted: 22 October 2011 09:45 PM Total Posts: 75 [ # 1 ] This function should do it.
function addDistance(point:Vector3D, d:Number):Vector3D { It converts to spherical coordinates, adds the distance, then converts it back to an (x,y,z) Cartesian point. |
||
maddog, Sr. Member
Posted: 22 October 2011 11:46 PM Total Posts: 118 [ # 2 ] Thanks for the help. It projects parts at a constant distance, but not angle like I want unless I am still doing it wrong. this is the code so far.
function addDistance(point:Vector3D, d:Number):Vector3D { Here is what happens with that code: |
||
|
||
80prozent, Sr. Member
Posted: 23 October 2011 01:06 AM Total Posts: 430 [ # 4 ] hi i think what you need to do is to move the verts along their normals. you find more info about this in this thread: http://away3d.com/forum/viewthread/979/ hope that helps 80 |
||
maddog, Sr. Member
Posted: 23 October 2011 01:44 AM Total Posts: 118 [ # 5 ] I think my problem was the sphere was not aligned right to origin. I took it back into blender and realigned origin to mesh and it worked. I have notice a glitch where sometime pieces lose there mouse enabled status and no longer are able to be clicked. any ideas? |
||
John Brookes, Moderator
Posted: 23 October 2011 01:00 PM Total Posts: 732 [ # 6 ] You shouldn’t need to mess with spherical coords |