It would be very helpful if there was a scale() function for ITexture.
so that when it is set as a image for an object it can be scaled as the object size changes.
even for a splash screen image. i have to have different images for different resolutions.
finaly:the work would be simplified if there was a scale function in ITexture.
Feature Request: Scaling of Textures/images
Feature Request: Scaling of Textures/images
there are 10 kinds of people in this world,
one who can read binary and one who cant.
one who can read binary and one who cant.
I made this GUI skin thing that implements IGUISkin by drawing scaled images.
http://irrlicht.sourceforge.net/phpBB2/ ... sc&start=0
The drawing code is a bug fixed version of this code:
http://www.irrforge.org/index.php/Playi ... h_Irrlicht
Spintz is right. As a 3D engine Irrlicht already supports scaling & rotation 'out of the box'. A flat, 2D image could be called a BillboardSceneNode
. Then you would just set the BillboardSceneNode's scale via IBillboardSceneNode->setScale() function, although you'll have to do some math (or steal mine) if you want to setScale to an exact pixel size.
If you play with the 09.meshviewer example, there is a 'set scale' text box. Try changing the scales to values other than 1.0 and see how the mesh changes.
A 2D image would just be a one rectangle 'mesh' that always faces the camera (orthogonal).
Maybe the 'AnimatedSpriteSceneNode' class should be included as a part of Irrlicht so that people will have a simple way to do 2d scaled images?
http://irrlicht.sourceforge.net/phpBB2/ ... sc&start=0
The drawing code is a bug fixed version of this code:
http://www.irrforge.org/index.php/Playi ... h_Irrlicht
Spintz is right. As a 3D engine Irrlicht already supports scaling & rotation 'out of the box'. A flat, 2D image could be called a BillboardSceneNode
If you play with the 09.meshviewer example, there is a 'set scale' text box. Try changing the scales to values other than 1.0 and see how the mesh changes.
A 2D image would just be a one rectangle 'mesh' that always faces the camera (orthogonal).
Maybe the 'AnimatedSpriteSceneNode' class should be included as a part of Irrlicht so that people will have a simple way to do 2d scaled images?
-
Guest
one thing I have found switching from using screenspace 2d Using Draw2DImage to using the flexible emil/zenaku code is that my graphics look rougher around the edges. Before with draw2dimage or guielement draws the alphablending of the edges of my textures used as osi elements were ultra smooth (of course they didn't scale properly and then looked like crap) - but they were perfect at native res.
Now, even at native res, it seems the edges are rougher, the alpha blend is not as smooth, maybe it's the vertex/texture mapping as it is used: 0-1 instead of the "notorious" 1:1 texel/screen mapping which uses a -0.5 offset (can't remember the details now). If not, what else could it be, any ideas what draw2Dimage does differently to keep those edges smooth? setFilter stuff (linear instead of point for example)??
cheers
Now, even at native res, it seems the edges are rougher, the alpha blend is not as smooth, maybe it's the vertex/texture mapping as it is used: 0-1 instead of the "notorious" 1:1 texel/screen mapping which uses a -0.5 offset (can't remember the details now). If not, what else could it be, any ideas what draw2Dimage does differently to keep those edges smooth? setFilter stuff (linear instead of point for example)??
cheers
