Thread: Model Not Showing up on screen...

  1. #1
    Absent Minded Programmer
    Join Date
    May 2005
    Posts
    968

    Model Not Showing up on screen...

    Okay, so here is my new update function...

    Code:
    	void Update()
    	{
    		this->GetFinalMatrix() =  ParentNode->GetFinalMatrix() * LocalMatrix;
    		glPushMatrix();
    		glLoadMatrixf(this->FinalMatrix.readArray());
    		CSceneNode::Update();
    		glPopMatrix();
    	}
    This updates the transformation to be relative to the parents final transformation (kinda like car wheels, or the flame on a torch, etc etc..)...

    Everything is multiplying correctly, all the matrices (4x4 matrices) are initialized as identity matrices, I havn't done any rotation or translation yet, this->GetFinalMatrix() should look like this when we send it to the glLoadMatrixf function:

    [1 0 0 0]
    [0 1 0 0]
    [0 0 1 0]
    [0 0 0 1]

    This should be the same as calling glTranslatef(0.0, 0.0, 0.0) in place of the glLoadMatrix function...

    Unfortunately this isn't working, the model isn't showing up on the screen, I've debugged and made sure that the final matrix being send to the gl pipeline IS a 4x4 identity matrix..

    Now I'm getting to the point where I believe that this is an opengl issue I'm having, maybe misunderstanding the functions?

    What am I doing wrong to not have my model show up on my screen?

    EDIT: Could it be that the final matrix is an identity matrix, but is in the form of FinalMatrix[16] and not FinalMatrix[4][4] ?
    Last edited by Shamino; 04-05-2006 at 09:12 AM.
    Sometimes I forget what I am doing when I enter a room, actually, quite often.

  2. #2
    User
    Join Date
    Jan 2006
    Location
    Canada
    Posts
    499
    Sometimes matrices are stored vertically instead of horizontally, if you know what I mean. And what library are you using to load the model in the first place? If you wrote it yourself, maybe you should try using a pre-built library, and once you get that working, rewrite your existing library.

    Also, (I'm trying to load models myslef) when tried it, it didn't work at first because my hand-made model was way to small! It looked fine in the modelling program, but when I compared it to other models that I had downloaded from the internet, I realized that my model had to be much larger. After a scaled it up a bit, it worked. Now all I have to do is texture map this thing.....

  3. #3
    Absent Minded Programmer
    Join Date
    May 2005
    Posts
    968
    It isn't the model loading I'm having trouble with, I know that works, its true and tested , it is the translating through matrices that is giving me trouble.
    Sometimes I forget what I am doing when I enter a room, actually, quite often.

  4. #4
    Absent Minded Programmer
    Join Date
    May 2005
    Posts
    968
    I know opengl uses a left handed coordinate system, i think, but I didn't think I would really have to worry about that....

    What to do what to do..
    Sometimes I forget what I am doing when I enter a room, actually, quite often.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Model not showing up on screen...
    By Shamino in forum Game Programming
    Replies: 14
    Last Post: 03-09-2006, 08:00 PM
  2. Feedback: Functional Specification Wording
    By Ragsdale85 in forum C++ Programming
    Replies: 0
    Last Post: 01-18-2006, 04:56 PM
  3. char copy
    By variable in forum C Programming
    Replies: 8
    Last Post: 02-06-2005, 10:18 PM
  4. i am not able to figure ot the starting point of this
    By youngashish in forum C++ Programming
    Replies: 7
    Last Post: 10-07-2004, 02:41 AM
  5. Help with file reading/dynamic memory allocation
    By Quasar in forum C++ Programming
    Replies: 4
    Last Post: 05-17-2004, 03:36 PM