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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T10:49:01+00:00 2026-06-03T10:49:01+00:00

I originally stored an objects origin and orientation in 3D space using 3 vectors

  • 0

I originally stored an objects origin and orientation in 3D space using 3 vectors representing the objects origin, forward and up directions.

To apply to correct transformation to the modelview matrix stack I compose the affine transformation matrix using these three vectors.

Translation is trivial, however for rotation is applied by constructing the correct rotation matrix (depending on the angle and axis of rotation) and applying it to these 3 vectors.

I’m using this method for a very large number of objects and the rotation/ affine matrix composing is causing a performance bottleneck.

I’m wondering if there is a more sensible/efficient way to store the orientation?

  • 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-03T10:49:14+00:00Added an answer on June 3, 2026 at 10:49 am

    I originally stored an objects origin and orientation in 3D space using 3 vectors representing the objects origin, forward and up directions.

    Or in other words: You’re storing a 3×3 matrix. The matrices OpenGL use are just the same, though they’re 4×4, but the only difference to your is, that the element 4,4 is always 1, the elements 0…3,4 are all 0, and the first column 0,0…3 is the cross product of forward and up, usually called right.

    This is actually the most concise and directly accessible way to represent an objects placement in 3D space. You can apply any kind of transformation, by performing a single matrix multiplication then.

    Another method is using a quaternion together with an offset vector. But quaternions must be turned into a matrix if you want your objects to be translatable (or you could chain up a lot of translation/rotation pairings for a transformation hierachy, but using a matrix actually causes less overhead).

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

Sidebar

Related Questions

I have some data which I originally stored in a generic Javascript object, with
I need to store JSON-like objects in our postgres DB. Originally I was just
I'm trying to copy a file using a hardlink, where the file is stored
I store various user details in my MySQL database. Originally it was set up
I have a chess game that originally used an stl list to store the
i have several classes with members called 'Id'. Originally i wanted to store these
I have stored images from the net like this Documents/imagecache/domain1/original/path/inURI/foo.png Documents/imagecache/domain2/original/path/inURI/bar.png Documents/imagecache/... Documents/imagecache/... Now
I've managed to get the original filename of a photo stored in the asset-library
Originally I had a design problem where I needed five subclasses of a superclass,
Originally I had two tables in my DB, [Property] and [Employee]. Each employee can

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.