Posted: 18th Jun 2007 9:05
I looked up camera orbiting in the archives, and I found some pretty useful formulas. However, I'm having one issue... well, a few really, but one major one. I can't control how far up the camera goes.

To explain, what I want is that once the camera reaches about 85 degrees on the x-axis (almost looking straight down), it can go up no further and just orbits around the object on the x and z axis, because once it reaches 90 degrees, it flips the camera around, which is very jumpy and glitchy looking.

Also, I have the camera rotate around a 3d mouse coordinate, which is a dummy object that follows the mouse while staying on whatever the level of terrain is. When I click on a spot, the whole view jumps over to where it is. It would be better to cast a ray from the camera to the ground, find where it intersects, and then orbit around that, because when i hold down the mouse button (which makes the camera orbit) it would not jump, but merely orbit from that position.

A final problem is that sometimes when i initiate the orbit, the camera randomly jumps to under the terrain, looking up.

All this to say... help!
Posted: 18th Jun 2007 19:27
cant you always point the camera at your object using POINT CAMERA and then zoom in and out from your object using MOVE CAMER?

Sorry if im wrong... I havnt done any 3D in a loooong time...
Posted: 18th Jun 2007 19:57
i mean, yeah, but you can't orbit around it very well without complicated math crap.
Posted: 18th Jun 2007 20:41
did you try set camera to follow? It has smoothing and just assign an angle for it and it rotates around the object

-Jim
Posted: 22nd Jun 2007 4:47
O RLY?????????????????? thanks i'll try that.
Posted: 22nd Jun 2007 4:58
uhm... not exactly working... i'll show you what i have...

+ Code Snippet
   x#=object position x(5000)
   y#=object position y(5000)
   z#=object position z(5000)

   dist#=sqrt(((camera position x()-x#)^2)+((camera position y()-y#)^2)+((camera position z()-z#)^2))

   a#=wrapvalue(a#+mousemovex())
   b#=wrapvalue(b#+mousemovey())
   position camera x#+(sin(a#)*sin(b#)*dist#),y#+(cos(b#)*dist#),z#+(cos(a#)*sin(b#)*dist#)
   point camera x#,y#,z#


object 5000 is what's being rotated around.