Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Texture matrix  (Read 2925 times)

0 Members and 1 Guest are viewing this topic.

Mr_Blame

  • Full Member
  • ***
  • Posts: 192
    • View Profile
    • Email
Texture matrix
« on: August 19, 2015, 10:50:58 am »
Hello.

In OpenGL there are lots of matrixes for position transforming(e.g. projection, model and texture matrix).

So. We can use this texture matrix for some tricks  ;) e.g. this code will rotate texture not model that contains it:
//OpenGL 1.x style (aka fixed pipeline)

//select texture matrix
glMatrixMode(GL_TEXTUREMATRIX);

//rotate texture
glRotatef(45, 0, 0, 1);

//select model view matrix just in case
glMatrixMode(GL_MODEL_VIEW);
 
P.S. Later I will upload result screenshots. Also I heard about vertex arrays that contain tex cords but it will be maybe hard for some people to set them to make texture rotated. :D
« Last Edit: August 19, 2015, 10:53:01 am by Mr_Blame »

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Re: Texture matrix
« Reply #1 on: August 19, 2015, 11:31:50 am »
I don't think we'll add new features that use deprecated OpenGL stuff. You'd better switch to the modern way of doing this, i.e. using a shader.
Laurent Gomila - SFML developer

Mr_Blame

  • Full Member
  • ***
  • Posts: 192
    • View Profile
    • Email
Re: Texture matrix
« Reply #2 on: August 19, 2015, 11:43:13 am »
Okay I understand it, sir.

Also little question in which far futureTM will SFML switch to modern OpenGL aka full graphics programming with shaders?
« Last Edit: August 19, 2015, 11:46:08 am by Mr_Blame »

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Re: Texture matrix
« Reply #3 on: August 19, 2015, 11:46:29 am »
Quote
Also little question in which far futureTM will SFML switch to modern OpenGL aka full graphics programming with shaders.
You might still be alive when it happens.
Laurent Gomila - SFML developer

Mr_Blame

  • Full Member
  • ***
  • Posts: 192
    • View Profile
    • Email
Re: Texture matrix
« Reply #4 on: August 19, 2015, 11:51:07 am »
okay  ;D

 

anything