Reputation: 408
I have a grassland where i have rendered a quad using instanced rendering with a texture containing alpha channel.
So far it looks ideal, except it doesn't move/animate. its just a quad rendered onto the screen, which just sits still and does nothing.
What I am trying to achieve here is simple, I want a way to be able to move the quad, using some trignometric function [sine] for example, but I dont want to move the whole quad, only the upper part of it.
Upvotes: 0
Views: 162
Reputation: 48216
shearing is what you are after.
first transform the quad so the bottom is at Y=0 then multiply with
[1,d,0,0,
0,1,0,0,
0,0,1,0,
0,0,0,1]
and then transform it to where you need it to be
and let d vary around 0
Upvotes: 4