automatic rotating camera
in
Contributed Library Questions
•
1 year ago
Hi there!
What could I be doing wrong?
I have a box defined by width, height and depth. I want the camera to keep looking at the centre of the box (width/2, height/2, depth/2) and move around in a constant rate, in the XY plane, which defines width and height.
I've tried this:
- float xpos= cos(radians(rotation));
- float ypos= sin(radians(rotation));
- camera(xpos+width, ypos+width, depth/2, width/2, height/2, depth/2, 0, -1, 0);
- rotation+=10;
but haven't succeded (width and height are from the screen size and depth is an average of those).
I'd also probably like to make this using peasycam to keep the hud it makes... but of course I could just block the mouse and keep the peasycam there... just because of the hud.
What could I be doing wrong?
Any ideas?
1