## 3d cartesian to polar problem

Aug 18, 2011 at 1:06am

# 3d cartesian to polar problem

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:
#58525
Aug 18, 2011 at 3:05am

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. –
#210316
Aug 18, 2011 at 12:33pm

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

#210317
Aug 8, 2012 at 2:48pm

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

#210318
Sep 10, 2012 at 11:13pm

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

#210319

You must be logged in to reply to this topic.