Hello everyone I have this problem that I have tried everything I could think of. The problem: I am making a 2D game with parallax effect but I am using 3d space so am not simulating the parallax but letting the perspective projection take care of it for me. now the problem i have my own game editor where I design the levels, in this editor I use just images and I set a Z value for each layer. however I want the layers to show in the game engine exactly as I set them in the game editor, in short I want perspective projection to do parallax but without changing their scale or offset/position.
obvious solution is to scale them up and offset them but the problem how to calculate their offset? with scaling I tried object->Scale(object.Z/view.Z) and seems to return them to their real size but their positions are still wrong. I tried object->setPositionX(object->getPosition().x*(object.Z/view.Z)) and seems to be aligned except they all seems shifted.
I have tried unprojecting and tried to convert from world matrix to screen matrix and find some ratios and so on.
If anyone have any idea or anyway how this could be done in an elegant/mathematical way , I will be most grateful.
Thank you all in advance.