Camera keeps flipping between perspectives

Hey all,

I have set up a camera to follow a path on a circle, looking at a rectangle. It is circling around it nicely, though, rhythmically, it changes position between looking at it from the top, tilted down, and then from the bottom, seemingly tilted down. ezgif-7-4f08c13812d2

edit — seems like it’s happening exactly when the camera crosses the middle of the longer edge of the rectangle. Could it have something to do with the “look at”?

Thanks for any help!

It is possible for the “look at” behaviour to cause flips in some situations; however, I couldn’t reproduce that when I setup a similar scene to yours.

Two quick thoughts: I noticed in the screenshot that your camera is also constrained to “light1”, is that necessary? Could that be affecting your camera position?

Also, which version of TouchDesigner are you using? The 2021 series has a new ‘Forward Direction’ parameter that is used to help the “look at” behaviour and might be useful to you.

If neither of those help, would you be able to post your file to see if we can recreate the problem.

hey, thanks for your reply!

I have the lights linked to the camera to always light the rectangle evenly, while the camera is on a circle path.

I just updated to the newest version and still have the current issue of the camera flipping, I played with the ‘Forward Direction’ parameter but no results :confused:

I uploaded my file below, everything inside the geo is super messy, but the problem with the camera is outside that anyhow :wink:

Thanks for you help!

camera_flipping_issue.toe (32.0 KB)

Thanks for the file - that makes it a lot easier to see what is going on. When I tested it, I was assuming the rectangle was in the XZ plane and the camera was looking down on it rather than that the camera was circling in the XY plane and going upside down.

The quick fix is that you need to set the ‘Look At Up Vector’ parameter to ‘Use Up Vector’ and then set the ‘Orient Up Vector’ to 0,0,1 This makes sure that the up vector is always perpendicular to the lookat direction so that the camera doesn’t flip.

I’ve attached two versions of your file here. In the first one, I changed a few things around while I was debugging it that you might find useful. I scaled and moved the circle path rather than giving a translate in the camera and I constrained the light to the camera instead of the camera to the light. I found it a little simpler to debug the camera position when there were fewer things affecting it. Personally, I’d also reorient my scene so that the geo was in the xz plane and the camera was looking down at it so that it never had to go upside down, but that’s up to you.

In the second version I just did the fixes to the look at vector as mentioned above and left everything else alone.

I hope that helps. Let me know if you have any questions.

camera_flipping_issue_fix1.toe (16.2 KB)
camera_flipping_issue_fix2.toe (16.0 KB)

Wow, thanks a lot for the effort into this, works nicely and is really much appreciated! This community really has helped a lot already making me understand touchdesigner more and more

1 Like