Hello,
I hope my explanation makes sense...
I'm trying to calculate the x and z position of the 3d camera in order to orbit round the middle of my layout, always facing the center of the layout at a z position of 0.
ranges are
x: -100 to LayoutWidth +100
z: -100 to 100
If we pretend the layout+100 is 2000 wide for the sake of simplicity, the following should be true for each quarter of the orbit:
x z desc
---------------------
0 0 Cam pos is far left and layout middle (edge on looking right)
1000 100 Cam pos is front and center of the layout
2000 0 Cam pos is far right (edge on looking left)
-1000 -100 Cam post is rear center looking in from the back
At the moment I've been incrementing and decrementing values to try and do this, and the result is more like ping pong than an orbit (example project https://www.dropbox.com/s/64dgaklczg96eu3/3dOrbit.c3p?dl=0).
I'm sure theres a nice calculation that can make this work nicely and produce a smooth constant orbit, but so far I haven't worked it out; my math muscles are in need of some exercise.
I've also looked at orbit and rotation behaviours to try and solve this, but they only rotate round the xy axis and not the z; which is important to me.
Any help would be appreciated.