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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T15:29:31+00:00 2026-06-11T15:29:31+00:00

I have a vector which points from my camera to an object I want

  • 0

I have a vector which points from my camera to an object I want to point to, so I want to make a quaternion which rotates the camera so that it points to that vector. So i do this (using glm)

glm::quat rotation=glm::angleAxis(0.0f,vector);

If i understand that function correctly in the case of a vector of, for example, (0.0f,0.0f,-1.0f), the camera should point forward in the depth axis, and with no roll. But i don’t know why, in that case it creates this quaternion:
x:-0
y:-0
z:-0
w:1
wich does nothing, and the x,y,z values only differ from 0 if the angle parameter passed to angleAxis() is different from 0. Why does this happen? if i pass angle 0, shouldn’t it simply create a rotation with only yaw and pitch, and no roll?

  • 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-06-11T15:29:33+00:00Added an answer on June 11, 2026 at 3:29 pm

    Already go the answer: (on the gameDev forum, from the user clb)

    No, your understanding is off. Angle-axis rotation generates rotation about the given axis, by the given angle. If you don’t specify an angle, you’ll always get identity back. This is because rotation a zero angle, be it about any axis, of course does not rotate at all.

    What you are thinking about is the LookAt rotation. I am not sure what the function signature in glm is, but I’m sure they have a similar function. Use a LookAt rotation to orient one direction vector to face towards another vector.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a vector, which contains a class object. I declared like this vector<Aircraft>
I have a class that has a vector member variable, which I fill up
I have a direction vector that applied to a position gives me the point
I have a std::vector that holds a Point struct (x,y,z and some other non-pointer
I have a vector of points, and I need to get those which are
Say I have a vector which has thousands of elements. What is the R
I have a vector of strings which are changing its contents for no apparent
So I have a container(any kind, probably std::map or std::vector) which contains objects of
I have a vector of pairs representing hops between nodes which I would like
Lets say if I have a vector V, which has 10 elements. If I

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.