Jump to content

  • Log In with Google      Sign In   
  • Create Account


Why is my screen centered 0,0 in the middle of screen?


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
21 replies to this topic

#21 MARS_999   Members   -  Reputation: 1238

Like
0Likes
Like

Posted 20 June 2013 - 09:53 PM

I think you need some clarification. If your view and projection matricies are identities (not set), you get an orthogonal observation and your screen will contain only objects that are in -1 , 1 scope. That is, that if you have object of 4 verticies with values in object space (the object space equals your projection space now) such as 1.0,0.0, it will be placed at vertical center and at right edge of screen, and 0.0,0.0 will be placed at the center, -1.0,1.0 is the upper left corner. Do not confuse this with placing at screen resolution coordinates, 100,100 will place the thing 100 screens to the right up! If you want to place by screen pixel width height, divide by dimensions of screen then. Also realize that ortho camera has its certain scope of view, so if you devide everything by some value, say 1000, then you will be observing 1000.0,-1000.0 square, thus then -1000.0,1000.0 is your upper left corner. You cans still apply some world matricies to the objects. Also finaly, ortho camera may have rotation but this is often not desired, but ortho camera may need translation. So you should set up a view matrix with translation only, and apply that matrix. So in the end you are using only world matrcies per object, view matrix with only translation, and a projection matrix that only scales thing down by a single division. Possibly

 

Thanks johnny for the explanation, so do you have some code of this in action? I never had to setup this before. So I could learn from that code? I am using Irrlicht obviously...

 

THanks!



Sponsor:

#22 MARS_999   Members   -  Reputation: 1238

Like
0Likes
Like

Posted 20 June 2013 - 10:32 PM

SHOOT me!!!!

 

I found it... sigh...

 

It was this

IParticleSystemSceneNode* ps;

ps->setPosition();

 

I called that when I was rendering which sets the relative to its parent node...

 

I took that out and now we are running smooth! :)

 

Thanks for the help and explanation!!!






Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS