Glitchy values in CC Sphere with expressions
- August 2, 2024
- 3 replies
- 270 views
Hello,
I’m have a few pseudo-spheres using CC Sphere, that I am moving around. To simulate a common lighting (from the top left), I have some expressions in the Light Height and Light Direction of all the spheres.
It kinda works, but it’s glitchy: the lighting jumps from one condition to another at seemingly random moments, and not for every sphere at the same time.
See the attached reduced debug file, with only one sphere. Watch the animation in full. Instead of being smooth, the lighting jumps, for instance at 0:00:01:12, at 0:00:03:05, at 0:00:04:18, at 0:00:10:19, etc.
I’m using these expressions:
Light Height:
100 - Math.sqrt(transform.xPosition^2 * transform.yPosition^2)*2(Pythagoras to get the distance from the top left corner and scale it to the property)
Light Direction:
-radiansToDegrees(Math.atan(transform.xPosition/transform.yPosition))(Trygonometry to get the angle from the top left corner)
Could someone help me find out what’s actually happening? Thanks!
