Any ideas on how I might go about zooming an object (the scale of said object can be changed if need be) on screen in such a way that the texture on the object is displayed at a 1:1 texel:pixel size ratio?
I'm aware that you could use IVideoDriver::draw2DImage to achieve that, but I'm working on an advanced graphical editor that needs the ITexture to be displayed on an IMesh in order to achieve many of the features/effects being used elsewhere, so I'm looking for a way to just position/scale that ISceneNode, or perhaps the ICameraSceneNode in such a way so as to achieve my desired result.
Any thoughts?
How to zoom ITexture to 1:1 pixel size? [Solved]
How to zoom ITexture to 1:1 pixel size? [Solved]
Last edited by Nyxojaele on Wed May 06, 2009 4:47 am, edited 1 time in total.
So for anybody interested, what I ended up doing was switching the camera to orthogonal mode, then it was simple:
- Set the ISceneNode up with a custom Mesh (a flat mesh 1 unit x 1 unit in size).
- Scale the custom mesh to the dimensions of the texture.
- Set the camera's orthogonal viewable dimensions to the physical dimensions of the window irrlicht is rendering in.
- Voila, texture rendering at pixel perfect size. Zoom in/out by changing the camera's viewable dimensions.