 # Understanding Rotation Constraint + Shrinkwrap

I think you should use the method I demonstrated. The screens above should demonstrate how it’s the same as your movie. That will protect you from errors from trying to find the Z position of the buoy before you know which XY position to check for Z…

So if you want, you can have the buoy at a rest pose horizontal with its parent, and then determine the angle from the projection-- the distance along the Z axis. You could have it at some other rest pose, but then you’d need to do a bit more math (just algebra, subtract the angles found from two different projections.)

Of course, drivers work in radians, not degrees. There are 2*pi radians in 360 degrees.

Thank you for your really good graphical explanation. Can I ask some things If I draw on it?

Lol of course.

Sorry, I got my trig functions mixed up, should be sine instead of cos. Edited image.

HI. Here is a schema of what I am doing now:

According to your proposal (last sketch you posted with the math formulas):

I need to measure the arm (data I have). The Projection will be given by the distance between the empty when the buoy is in the 0 points and my shrink-wrapped empty. The theta variable I have it when the water is still. But I guess that’s the relevant variable when I want to find out the rotation of the axis and the ocean moving. Do you think I can input your tips in the driver parameters?

You’ve left empty.001 off your schematic. Getting distance isn’t the right thing here, because it’s not a signed value, it’s an absolute value, and so won’t do what we want (think about what happens when the sea level raises above the origin and the empties swap positions.)

So instead, let’s get the Z position of “Empty 0” and the Z position of Rotational Axis. We’ll call these E1 and E2 respectively.

Let P = E1-E2. Let L = the length of the arm (from origin of rotation to empty.) Let A = rigged “rest” angle in degrees (-5, according to your picture-- the origin of rotation is the cylinder, remember, so we want to be measuring its angle to the horizontal, not the cube’s angle to the horizontal, that’s why I’m flipping the sign.)

The angle from the horizontal is asin(P/L). The same angle, measured in degrees instead of radians, is asin(P/L)*180/pi. (Because 360 degrees equals 2pi radians, so 180 degrees equals pi radians.) Since your buoy is not rotated to the horizontal at rest, the angle difference is (asin(P/L)*180/pi) - A. That is, (asin(P/L)*180/pi)+5.

I think I am getting to understand your instructions ! Thank you so much.
Now I will need to find out if its possible to add them to a driver without python. I do not know to use that.
Do you know if the explanation you shared with me is able to be handled by drivers options already provided in Blender?
Thank you

A driver uses Python. That’s what it does. It’s a short Python script, interpreted by Blender. It can be a single line script.

I will try to find out how to input your instructions and see what happens. Thank you !