Stride Forums Archive

Orbit Camera for puzzle game

4 posts, 2062 views, 2019-04-05 to 2019-04-14

MentalArray (Gavin) 2019-04-05 #1

Hi there anybody know how to make an orbit camera im making puzzle game i have one in Monogame but im moving to Xenko for the fantastic pbr and the easier interface is it a case of just copying the basic camera and fitting my current code in the update ?
many thanks

Jarmo (Jeremy) 2019-04-14 #2

This is how I would would try to do it.

  1. Create a camera controller entity, place the position at 0,0,0.
  2. Place a camera at say… 20, 0, 0 as a child entity w/ camera component.
  3. Rotate the camera view toward the parent entity’s 0,0,0 manually in Game Studio.
  4. Wire up controls to rotate the base entity X, and Y (or Z) depending on rotation.
  5. ^ Controls would be click and drag deltas in 2d Mouse space, or could be raycast deltas in 3d space.
  6. Rig up the mouse wheel to move X + or -.

I find camera stuff easy to work with Xenko… looking forward to seeing what you come up with!

MentalArray (Gavin) 2019-04-14 #3 in reply to #2

thanks jarmo i will give it a try im surprised there is not allready a built in Arcball camera as this is used a lot.

MentalArray (Gavin) 2019-04-14 #4 in reply to #2

Yaaaa thanks Jarmo it worked