FORUM CLOSED, PLEASE REGISTER AT FORUM.SIO2INTERACTIVE.COM
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Setting 'Top-Down' Camera Perspective Problem

3 posters

Go down

Setting 'Top-Down' Camera Perspective Problem Empty Setting 'Top-Down' Camera Perspective Problem

Post  monkeys Mon Aug 03, 2009 6:48 am

I'm trying to use a simple 'top-down' camera perspective to view my small scene, which is small enough to fit on the screen at once, so I want to be directly centered over the scene.

The Problem I try to set the camera in blender to a 'Top-Down' perspective, that is, viewing the scene from directly above (camera Rot x = 0.0, y= 0.0 z = 180.0), the scene will render as extremely far away, even if my camera is very close to the scene in blender. It also displays some strange perspective behaviour as things move closer and further away on the scene.

I think this must have something to do with the perspective settings in blender or something, because i've noticed that if i move the camera to that it is not quite directly above the scene, ie. facing slightly upwards (camera Rot x=10.0, y=0.0, z=180.0), then the behaviour is nowhere near as bad. It's only as you approach being directly above the scene that the behaviour occurs.

I'm sure someone must have coma across something like this before, while attempting to use a top-down camera perspective? Can anyone shed some light on this for me?

monkeys

Posts : 8
Join date : 2009-07-22

Back to top Go down

Setting 'Top-Down' Camera Perspective Problem Empty Re: Setting 'Top-Down' Camera Perspective Problem

Post  sio2interactive Mon Aug 03, 2009 7:45 am

Just use sio2LookAt, its the same as gluLookAt
sio2interactive
sio2interactive

Posts : 1526
Join date : 2008-08-26
Age : 44
Location : Shanghai

http://sio2interactive.com

Back to top Go down

Setting 'Top-Down' Camera Perspective Problem Empty Re: Setting 'Top-Down' Camera Perspective Problem

Post  monkeys Mon Aug 03, 2009 8:37 pm

sio2interactive wrote:Just use sio2LookAt, its the same as gluLookAt

How would I go about implementing sio2LookAt? I've found this code on another part of the site:

Code:



void sio2LookAt( vec3 *_e,
            vec3 *_c,
            vec3 *_u )
{
    float m[ 16 ];
 
  vec3 f,
      s,
      u;
 
  sio2Vec3Diff( _c, _e, &f );
 
  sio2Normalize( &f, &f );

  sio2CrossProduct( &f, _u, &s );
 
  sio2Normalize( &s, &s );

  sio2CrossProduct( &s, &f, &u );
 
  memset( &m[ 0 ], 0, 64 );

    m[  0 ] = s.x;
    m[  4 ] = s.y;
    m[  8 ] = s.z;

    m[  1 ] = u.x;
    m[  5 ] = u.y;
    m[  9 ] = u.z;

    m[  2 ] = -f.x;
    m[  6 ] = -f.y;
    m[ 10 ] = -f.z;

    glMultMatrixf( &m[ 0 ] );
 
    glTranslatef( -_e->x, -_e->y, -_e->z );
}

But I'm not sure where to integrate it into my current application?

monkeys

Posts : 8
Join date : 2009-07-22

Back to top Go down

Setting 'Top-Down' Camera Perspective Problem Empty Re: Setting 'Top-Down' Camera Perspective Problem

Post  sio2interactive Mon Aug 03, 2009 8:45 pm

Just check the spec of gluLookAt
sio2interactive
sio2interactive

Posts : 1526
Join date : 2008-08-26
Age : 44
Location : Shanghai

http://sio2interactive.com

Back to top Go down

Setting 'Top-Down' Camera Perspective Problem Empty Re: Setting 'Top-Down' Camera Perspective Problem

Post  skaterazn Mon Aug 31, 2009 5:58 am

hello, i want to do the same thing, but i cannot figure out how to use sio2lookat.
does somebody have a sample code?

skaterazn

Posts : 12
Join date : 2009-07-03

Back to top Go down

Setting 'Top-Down' Camera Perspective Problem Empty Re: Setting 'Top-Down' Camera Perspective Problem

Post  sio2interactive Mon Aug 31, 2009 4:54 pm

sio2LookAt( vec3 <pos in worldspace>, vec3 <target in worldspace>, vec3 <normalized up vector> );
sio2interactive
sio2interactive

Posts : 1526
Join date : 2008-08-26
Age : 44
Location : Shanghai

http://sio2interactive.com

Back to top Go down

Setting 'Top-Down' Camera Perspective Problem Empty Re: Setting 'Top-Down' Camera Perspective Problem

Post  Sponsored content


Sponsored content


Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum