Results 1 to 2 of 2

Thread: big sphere, lil camera

  1. #1

    big sphere, lil camera

    say you have a big sphere and you put a camera on the sphere. when you move the camera it tranlates around the sphere's surface. but you want the camera to always be upright(for lack of a better word). like us on our planet when we move around we are always 'upright'. so how do you figure out the rotation of the camera from one point to the other as it moves along the surface?

  2. #2
    Senior Member Regular Contributor
    Join Date
    Feb 2000
    milano, italy

    Re: big sphere, lil camera

    you can do as follows, if you don't mind to get a singularity at the sphere's poles:

    -trace a ray from the sphere's center to the camera location.
    -normalize, call it Z
    -evaluate the cross product between Z and the sphere axis.
    -normalize, call it X
    -cross product between X and Z, call it Y

    now you have an orthonormal basis XYZ, wich its X and Y vectors are tangent to the sphere surface, and Z is the up vector.

    hope it helped

Similar Threads

  1. Replies: 2
    Last Post: 06-01-2013, 08:21 PM
  2. [Camera] Can't make the camera move appropriately
    By onion_bread in forum OpenGL ES
    Replies: 0
    Last Post: 12-01-2011, 07:36 PM
  3. Render a trimmed sphere ? (a quarter of sphere)
    By HaVyThoai in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 11-07-2007, 12:05 PM
  4. Camera Position / Camera Angle / Camera Target Position
    By bobGL in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 04-02-2007, 09:28 AM
  5. Sphere-sphere collision detection
    By Billy Lee in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 01-08-2003, 11:03 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
Proudly hosted by Digital Ocean