How to use only part of a texture?

Problems building or running the engine, queries about how to use features etc.
Post Reply
User avatar
mmixLinus
Silver Sponsor
Silver Sponsor
Posts: 199
Joined: Thu Apr 21, 2011 3:08 pm
Location: Lund, Sweden
x 12
Contact:

How to use only part of a texture?

Post by mmixLinus »

I have an Ogre::TexturePtr (Ogre 1.10) that comes from creating a 1024x1024 RTT in CEGUI (so it is CEGUI rendering to it), but want to use only sub-rectangles of it.
So,

Code: Select all

pass->createTextureUnitState(texPtr->getName());   // this works but shows the whole 1024x1024 bitmap
Is there an easy way of doing a createTextureUnitState() but instead specify a PART of my OgreTexture? Maybe creating several Ogre::Textures that actually point to different areas in the original 1024x1024?

Please help!
Thanks : )
Powered by Ogre3D:
MMiX.Me 3D - 3D Music Player
Galaxy Navigator 3D - 2 million stars (ESA's Gaia satellite)
YouTube|Facebook
xrgo
OGRE Expert User
OGRE Expert User
Posts: 1148
Joined: Sat Jul 06, 2013 10:59 pm
Location: Chile
x 168

Re: How to use only part of a texture?

Post by xrgo »

try with scale http://www.ogre3d.org/docs/manual/manual_17.html#scale
and scroll, to position in the right place
User avatar
mmixLinus
Silver Sponsor
Silver Sponsor
Posts: 199
Joined: Thu Apr 21, 2011 3:08 pm
Location: Lund, Sweden
x 12
Contact:

Re: How to use only part of a texture?

Post by mmixLinus »

Yes, of course! Thanks!!
Powered by Ogre3D:
MMiX.Me 3D - 3D Music Player
Galaxy Navigator 3D - 2 million stars (ESA's Gaia satellite)
YouTube|Facebook
Post Reply