Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1073075
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T20:56:37+00:00 2026-05-16T20:56:37+00:00

Right now my application rotates on camera.rotationX, Y Z and does a -translation of

  • 0

Right now my application rotates on camera.rotationX, Y Z and does a -translation of camera.x,y,z on the modelview matrix. How could I equivocate this to a call to gluLookAt?

Thanks

basically how could I get this:

    glMatrixMode(GL_MODELVIEW);
     glLoadIdentity();

//starts here
     glRotatef(Camera.rotx,1,0,0);
     glRotatef(Camera.roty,0,1,0);
     glRotatef(Camera.rotz,0,0,1);

     glTranslatef(-Camera.x , -Camera.y - 4.5,-Camera.z );

Instead into a call to gluLookAt which would make it look the same.

Thanks

The reason I want to do this is because I found a fustrum culling class that works with gluLookAt as seen below

void FrustumG::setCamDef(Vec3 &p, Vec3 &l, Vec3 &u) {

    Vec3 dir,nc,fc,X,Y,Z;

    Z = p - l;
    Z.normalize();

    X = u * Z;
    X.normalize();

    Y = Z * X;

    nc = p - Z * nearD;
    fc = p - Z * farD;

    ntl = nc + Y * nh - X * nw;
    ntr = nc + Y * nh + X * nw;
    nbl = nc - Y * nh - X * nw;
    nbr = nc - Y * nh + X * nw;

    ftl = fc + Y * fh - X * fw;
    ftr = fc + Y * fh + X * fw;
    fbl = fc - Y * fh - X * fw;
    fbr = fc - Y * fh + X * fw;

    pl[TOP].set3Points(ntr,ntl,ftl);
    pl[BOTTOM].set3Points(nbl,nbr,fbr);
    pl[LEFT].set3Points(ntl,nbl,fbl);
    pl[RIGHT].set3Points(nbr,ntr,fbr);
    pl[NEARP].set3Points(ntl,ntr,nbr);
    pl[FARP].set3Points(ftr,ftl,fbl);
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T20:56:38+00:00Added an answer on May 16, 2026 at 8:56 pm

    Well your eye position E will be (Camera.x, Camera.y + 4.5, Camera.z).
    The default view vector V is (0, 0, -1) in OpenGL, if I remember correctly and
    default up vector U is (0, 1, 0).

    So you rotate these two vectors with your camera rotation.
    See http://en.wikipedia.org/wiki/Rotation_matrix or http://en.wikipedia.org/wiki/Quaternion.
    Center is then the rotated view vector View vector + Camera vector.
    Up vector is simply the rotated up vector.

    gluLookAt(Camera.x, Camera.y + 4.5, Camera.z, Camera.x + V.x, Camera.y + V.y, Camera.z + V.z, U.x, U.y, U.z)
    gluLookAt(eyex, eyey, eyez, centerx, centery, centerz, upx, upy, upz : glDouble);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Right now i stuck in my application because of this issue. anyone help to
This is the scenario for the application right now: The application I am working
I have an application right now that starts a process, then opens a file
I am using Asp.Net/C# and Visual Studio 2008 to build an application.Right now I
Right now I have an MVC application running on http://127.0.0.1:8081/ (it is actually running
Right now whenever I run application It creates a file (file name specified in
Right now I am using sqlite within a ios application, and I want to
Right now, my application is using the c-ares asynchronous DNS resolver library on Windows
So right now I've developed an application that I'm trying to write an API
Right now, I'm writing a small java application by my own, with few maven

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.