Gamestudio Links
Zorro Links
Newest Posts
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
M1 Oversampling
by 11honza11. 04/30/24 08:16
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (AndrewAMD), 831 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
how to rotate a texture? #385027
10/11/11 18:45
10/11/11 18:45

M
mercuryus OP
Unregistered
mercuryus OP
Unregistered
M



how can i rotate a texture - like shifting with mtl_uvspeed?

Re: how to rotate a texture? [Re: ] #385030
10/11/11 20:01
10/11/11 20:01
Joined: Oct 2005
Posts: 4,771
Bay City, MI
lostclimate Offline
Expert
lostclimate  Offline
Expert

Joined: Oct 2005
Posts: 4,771
Bay City, MI
it will require some trig, i wont explain it in full because its a little compilicated but you'd want to look up using sin and cos functions if you look it up (soh cah toa) on google you should be able to find the proper info to figure it out. laugh

Re: how to rotate a texture? [Re: lostclimate] #385031
10/11/11 20:05
10/11/11 20:05
Joined: Jan 2003
Posts: 4,615
Cambridge
Joey Offline
Expert
Joey  Offline
Expert

Joined: Jan 2003
Posts: 4,615
Cambridge
Code:
x' = cos(a)*x - sin(a)*y
y' = sin(a)*x + cos(a)*y


then use that as lookup. You can also create a rotation matrix offline, pass it to your shader and use mul(...), that should be way faster.


Moderated by  Blink, Hummel, Superku 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1