ClutterBehaviourEllipse api changes; z_camera calculation

This commit is contained in:
Tomas Frydrych 2007-05-25 12:07:24 +00:00
parent 84257c9820
commit 4df0665012
2 changed files with 10 additions and 6 deletions

View File

@ -549,6 +549,8 @@ cogl_setup_viewport (guint width,
ClutterFixed z_near, ClutterFixed z_near,
ClutterFixed z_far) ClutterFixed z_far)
{ {
GLfloat z_camera;
GE( glViewport (0, 0, width, height) ); GE( glViewport (0, 0, width, height) );
GE( glMatrixMode (GL_PROJECTION) ); GE( glMatrixMode (GL_PROJECTION) );
@ -562,7 +564,9 @@ cogl_setup_viewport (guint width,
/* camera distance from screen, 0.5 * tan (FOV) */ /* camera distance from screen, 0.5 * tan (FOV) */
#define DEFAULT_Z_CAMERA 0.866025404f #define DEFAULT_Z_CAMERA 0.866025404f
GE( glTranslatef (-0.5f, -0.5f, -DEFAULT_Z_CAMERA) ); z_camera = CLUTTER_FIXED_TO_FLOAT (clutter_tani (fovy) >> 1);
GE( glTranslatef (-0.5f, -0.5f, -z_camera) );
GE( glScalef ( 1.0f / width, GE( glScalef ( 1.0f / width,
-1.0f / height, -1.0f / height,
1.0f / width) ); 1.0f / width) );

View File

@ -489,7 +489,8 @@ cogl_setup_viewport (guint w,
{ {
gint width = (gint) w; gint width = (gint) w;
gint height = (gint) h; gint height = (gint) h;
ClutterFixed z_camera;
GE( glViewport (0, 0, width, height) ); GE( glViewport (0, 0, width, height) );
GE( glMatrixMode (GL_PROJECTION) ); GE( glMatrixMode (GL_PROJECTION) );
GE( glLoadIdentity () ); GE( glLoadIdentity () );
@ -505,10 +506,9 @@ cogl_setup_viewport (guint w,
/* camera distance from screen, 0.5 * tan (FOV) */ /* camera distance from screen, 0.5 * tan (FOV) */
#define DEFAULT_Z_CAMERA 0.866025404f #define DEFAULT_Z_CAMERA 0.866025404f
z_camera = clutter_tani (fovy) << 1;
GE( glTranslatex (-1 << 15,
-1 << 15, GE( glTranslatex (-1 << 15, -1 << 15, -z_camera );
-CLUTTER_FLOAT_TO_FIXED(DEFAULT_Z_CAMERA)) );
GE( glScalex ( CFX_ONE / width, GE( glScalex ( CFX_ONE / width,
-CFX_ONE / height, -CFX_ONE / height,