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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T08:38:23+00:00 2026-05-31T08:38:23+00:00

I am currently teaching myself linear algebra in games and I almost feel ready

  • 0

I am currently teaching myself linear algebra in games and I almost feel ready to use my new-found knowledge in a simple 2D space. I plan on using a math library, with vectors/matrices etc. to represent positions and direction unlike my last game, which was simple enough not to need it.

I just want some clarification on this issue. First, is it valid to express a position in 2D space in 4×4 homogeneous coordinates, like this:

[400, 300, 0, 1]

Here, I am assuming, for simplicity that we are working in a fixed resolution (and in screen space) of 800 x 600, so this should be a point in the middle of the screen.

Is this valid?

Suppose that this position represents the position of the player, if I used a vector, I could represent the direction the player is facing:

[400, 400, 0, 0]

So this vector would represent that the player is facing the bottom of the screen (if we are working in screen space.

Is this valid?

Lastly, if I wanted to rotate the player by 90 degrees, I know I would multiply the vector by a matrix/quarternion, but this is where I get confused. I know that quarternions are more efficient, but I’m not exactly sure how I would go about rotating the direction my player is facing.

Could someone explain the math behind constructing a quarternion and multiplying it by my face vector?

I also heard that OpenGL and D3D represent vectors in a different manner, how does that work? I don’t exactly understand it.

I am trying to start getting a handle on basic linear algebra in games before I step into a 3D space in several months.

  • 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-31T08:38:24+00:00Added an answer on May 31, 2026 at 8:38 am

    You can represent your position as a 4D coordinate, however, I would recommend using only the dimensions that are needed (i.e. a 2D vector).

    The direction is mostly expressed as a vector that starts at the player’s position and points in the according direction. So a direction vector of (0,1) would be much easier to handle.
    Given that vector you can use a rotation matrix. Quaternions are not really necessary in that case because you don’t want to rotate about arbitrary axes. You just want to rotate about the z-axis. You helper library should provide methods to create such matrix and transform the vector with it (transform as a normal).

    I am not sure about the difference between the OpenGL’s and D3D’s representation of the vectors. But I think, it is all about memory usage which should be a thing you don’t want to worry about.

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

Sidebar

Related Questions

I am currently teaching myself c# but am confused by the following syntax: new
I'm currently teaching myself Drools Expert/Flow as well as GWT. I want to use
I am brand new to this, teaching myself, and could really use some guidance.
I've been teaching myself functional programming, and I'm currently writing different higher order functions
I'm currently teaching myself objective C. I've gone through the tutorials, but I find
Hey all, I'm currently teaching myself Objective C and I'm kind of stuck. I'm
I'm interested in teaching myself different data structures, something I currently know very little
I'm currently teaching myself python (coming from no programming background, but a lot of
I am currently trying to work with ImageMagick and teaching myself as I go.
my level of knowledge: i have just started teaching myself PHP and Dreamweaver after

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.