Forums > MaxMSP

3d cartesian to polar problem

August 18, 2011 | 1:06 am

Hello world,

I'm trying to figure out how to get a shape to orient itself (angle) according to the placement of 2 points in 3d space. I've got it working mostly, but for some reason it falls apart when the z value is between -1.0 and 1.0

This is a useful operation to orient "bones" between joints in a 3d skeleton provided by OSCeleton (kinect)

please see below, any help would be greatly appreciated (fail case image attached)

– Pasted Max Patch, click to expand. –

[attachment=169106,2544]

Attachments:
  1. Screenshot20110817at9.04.42PM.png

August 18, 2011 | 3:05 am

I thought it might be a message order or calculation order problem so I cleaned up your patch for you, but the problem is still there… I suspect it’s a 3d spatial calculation issue, which i know nothing about…
but anyway, the clean-up has made the patch a lot more efficient, and the message order is now explicit, using the trigger object– also note use of vexpr
EDIT: reposted patch (forgot to delete a redundant object)

– Pasted Max Patch, click to expand. –

August 18, 2011 | 12:33 pm

Thanks terry! that is indeed cleaner,
it was messy so I could get "dirty" flipping coordinates and angles if I needed to… I think it’s because these calculations rely on a degree of freedom less than 180… 3D math definitely isn’t my forté either!

anyway, thanks again for your help!

jeremy


August 8, 2012 | 2:48 pm

Hi Folks!
I’m also playing around with Kinect and Synapse having big problems to orient 3D bones..
Any solution?
Thanks,
Giorgio


September 10, 2012 | 11:13 pm

hey giolivo

try this

http://cycling74.com/forums/topic.php?id=41861

this isn’t the whole answer but its part of it, dig around on some math & other 3d graphics forums the answers are out there

/edit missed that this was from a a month ago & a year ago, nevermind! maybe someone will run into this and find it useful


Viewing 5 posts - 1 through 5 (of 5 total)