# How does the texture matrix operate?

This topic is 4814 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

if I have two quads, uv mapped as following...
 _____ _____
|     |     |
| /|\ |  |  |
|  |  |  |  |
|__|__|_\|/_|

The arrow points to up (on the texture map)


if I translate or rotate the texture matrix, will the quads be translated in the same way, or will they become "warped away" from each other? not sure how to explain what I mean, but if anyone understands what I'm saying... please respond! :) Peace!

##### Share on other sites
The texture matrix acts on the texture coordinates of geometry, not on the texture itself, or the geometry. I use the texture matrix to rotate and scale textures in my terrain engine. Gives me a lot more options with what I can do!

Also, I think the textures would become warped away from each other. Just an educated guess.

##### Share on other sites
So in other words, if I would draw a triangle fan around an island, and uv map so that all triangles' uv "point" inwards the island...

... would I be able to apply a foam/wave texture on the triangle fan and simply transform the texture matrix to get the waves moving towards the island? :)

just imagine, two or more layers of this - that would be a rather convincing shoreline, right? :)

##### Share on other sites
Quote:
 Original post by RasmadrakSo in other words, if I would draw a triangle fan around an island, and uv map so that all triangles' uv "point" inwards the island... ... would I be able to apply a foam/wave texture on the triangle fan and simply transform the texture matrix to get the waves moving towards the island? :)just imagine, two or more layers of this - that would be a rather convincing shoreline, right? :)

Yes you can but every triangle should point inwards the island. Then you have only to translate the matrix.
But the effect is credible only if you apply it near the island.

##### Share on other sites
Yes, that's what I meant! :)

so, a possible solution could be:

one big reflective water mass...

one or two layers of shoreline :)triangles, all pointing towards the island with their texture matrix modified along their "looking" direction...

Then glColor calls can be used to create fake fresnel effect on the shoreline too... :D

Got to try this when I get home from work! hehe.
Only problem will be to calculate the shoreline triangles, I guess!

Peace, ya´ll!

1. 1
2. 2
Rutin
19
3. 3
4. 4
5. 5

• 9
• 9
• 9
• 14
• 12
• ### Forum Statistics

• Total Topics
633301
• Total Posts
3011268
• ### Who's Online (See full list)

There are no registered users currently online

×