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

Started by
20 comments, last by MARS_999 10 years, 10 months ago

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!

Advertisement

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!!!

This topic is closed to new replies.

Advertisement