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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T23:47:24+00:00 2026-06-13T23:47:24+00:00

So I have a scene graph that holds all my objects, and I have

  • 0

So I have a scene graph that holds all my objects, and I have to use my own Matrix Classes for everything (Requirement, so not optional, school). I have all my math classes written but I am unsure how to to implement in code exactly the Matrix Stack.

I have a theoretical understanding of how it works. Basically my Scene is the identity matrix, then I have to take my camera matrix which I create using my Matrix 4 class, then from that I have to loop through the scene graph and glMultMatrix each level with its parent.

I think that is on the right track, but I have never coded this before and only studied the theory behind it.

Am I on the right track with this?

It should look this this.

Identity Matrix -> Camera Matrix ->
For Each Object
Reset back to Identity Matrix -> Camera Matrix – > Generate Matrix from Translate and Quaternion’s Multiply that with Identity Matrix -> Camera Matrix.
For Each Child
Generate Matrix from Translate and Quaternion’s Multiply that with the Parent’s Matrix

So Basically I have no glMatrixMode, just a Matrix Stack that exists because of my Scene Graph.

I hope this is on the right track.

  • 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-13T23:47:26+00:00Added an answer on June 13, 2026 at 11:47 pm

    Scene is the identity matrix

    No, the identity matrix is just a matrix, that multiplying with doesn’t change anything.

    I have to loop through the scene graph and glMultMatrix each level with its parent.

    Not really. The idea of doing your own matrix math, is not to rely on OpenGL doing anything for you. That includes matrix multiplication. If you actually use OpenGL fixed function matrices, you’d use glLoadMatrix. But better go the modern way: Use shaders and supply the matrices as uniforms.

    As a recap of how the transformation pipeline works, I refer you to https://stackoverflow.com/a/13223392/524368

    I hope this is on the right track.

    Almost, you’re thinking a bit too complicated. The nice thing about doing your own matrix math is, that you’re quite free in which way you implement things.

    Personally I’m a fan of in-place math operation. Using this paradigm, for each step in the matrix hierachy you’d take a copy of the lower level, and do your modifications on that one. Such a tree is nicely traversed. And for every drawing operation you just load the matrix at the branch/leaf in the transform hierachy tree, you’re currently traversing. And after drawing each thing, there’s no need for a reset, you just load the next thing, and maybe free the memory of intermediary results.

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

Sidebar

Related Questions

I have implemented a small scene graph to be rendered by OpenGL, all the
I have a large scene graph in Java 3D consisting out of a Group
I have a huge crazy scene in my story board that has 36 different
I have a scene that stores vertices in 3D space. What i would like
I have a scene that contains a group whose content consists of a large
i am using AndEngine. I have a scene that i would like to reuse
My app has 2 completely different objects that semantically require the same open graph
I have a scene that is rendered to texture via FBO and I am
I'm writing a simple scene graph to hold some objects so I can control
If have I have a game engine that has multiple threads that all work

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.