Problem with Expose Transform Helper angle


#1

Hi there!

Im hoping to get some help to solve a little problem.

I’m using two expose transform helpers for measuring two angles. Lets just call the angles A and B. A is variable over an animation and B is static.

Then i put the two angles from the expose helpers in to an expression controller like this:

if ( A < B, 1,0) 

So: If angle A is less than angle B return 1, or else return 0.

But there is a problem in the expose helper wich measures angle A. When angle A is 0 degrees the helper returns 180 degrees rather than 0. This causes the expression to return the wrong value in one frame or so when angle A passes 0 degrees, because angle B is less than 180 degrees.

Any ideas on how to fix this problem?


#2

Check the axis order that you’re measuring your angles, as that will affect your X Y Z output. The Expose Transform Helper (you’re using 3ds Max, right?) gives you the option to evaluate the axes in different orders. You may be running into a gimbal issue, and adjusting axis orders can mitigate that.


#3

Thanks for answering :slight_smile:
Yes, i am using 3ds max. I thought i had posted this in the max specific category, but i guess not. :blush:

Maybe i didnt explain good enough. I am not using the euler angles in the expose helpers, I am measuring the angles between objects in the scene. Basically i am using it as you would use the protractor helper object. (The difference is that you cant use the protractor in wiring and expressions)

So the problem arises when the two objects i am using to measure an angle gets at the same z-axis position. Instead of outputting that the angle is 0 degrees it says that is 180 degrees.

For this situation i actually just moved the bottom object so that the angle does not get to zero in the animation. Since im only using the difference between the angles in the expression and not any exact value of the angles it works fine that way.

A solution would might be to use two helpers with lookat constraints to the objects, and then using expose helpers to expose the constrained objects euler angles. havent tried it but i think it should work. I just think its a bit “messier”.


#4

This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.