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 6979893
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T17:56:39+00:00 2026-05-27T17:56:39+00:00

0Could you please help me out with this scenario: I have a 3D world,

  • 0

0Could you please help me out with this scenario: I have a 3D world, and I want to position the camera in a first-person manner( the real purpose would be a first-person view from inside a spaceship, while travelling through an asteroid belt). What would be the parameters for glulookat in this case? I thought of:

gluLookAt(30, 30, 30, 0, 0, 0, 0, 1, 0);//the up vector would be normal y axis

Would this be correct?

Also if I want the camera to move along with the ship, how would that be done? When moving the ship I should also move the “eye” coordinates from glulookat? Something like the eye coordinates(the first 3 parametres of glulookat) should be the same with the ship coordinates?

  • 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-27T17:56:40+00:00Added an answer on May 27, 2026 at 5:56 pm

    The gluLookAt call you propose would position the camera at (30,30,30) and point it at the origin.

    gluLookAt(Ship_Position_X,Ship_Position_Y,Ship_Position_Z,
              Ship_Forward_X,Ship_Forward_Y,Ship_Forward_Z,
              0,1,0);
    

    This is more like what you need. You’ll have to call it every frame so that the camera will follow the ship’s movement. If you want the ship to do a barrel roll, you’ll have to have additional variables to track the up vector.

    I like to have some kind of struct to hold co-ordinates so that I can overload gl functions to take them and write shorter function calls, e.g.

    // roll your own glVec, or use a co-ordinate class provided by a library you happen to be using.
    inline void gluLookAt(glVec position, glVec forward, glVec up)
    {
        gluLookAt(position.x,position.y,position.z,forward.x,forward.y,forward.z,up.x,up.y,up.z);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have NUnit installed at this directory. C:\Program Files\NUnit 2.5.5\bin\net-2.0 I made the directory
I have a datepicker on my ASP.NET C# web form and I want to
I've stucked on this and can't find way out :/ I'm trying to do
When creating a list of facet values, I have this in my schema: <field
I want to use MEF with asp.net mvc. I wrote following controller factory: public
I have a dataframe like z: z <- matrix(c(1,0,0,1,1,0,0, 1,0,0,0,1,0,0, 0,0,0,0,0,0,0, 0,0,1,0,0,0,0), nrow=7, dimnames=list(LETTERS[1:7],NULL))
I have the following string: [{EventType:1,ParticipantId:1,X:123,Y:123},{EventType:2,ParticipantId:1,ParrentList:[123,124,125,126],X:0,Y:0}] Could anybody give me an idea on how
This may sound really noobish, and I'm probably missing something really stupid.. But, I'm
This is a followup question to this question , initially inspired by this question
If you use a LEFT JOIN and also have a WHERE clause, are all

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.