Sign in to follow this  

Opengl complexes transformations

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

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, I have a question for you: If translate transformation is made with matrix 1 0 0 x 0 1 0 y 0 0 1 z 0 0 0 1 where x, y, z are arguments of glTranslatef(x,y,z); How can I use matrices like this 1 0 0 0 0 f(y) g(y) 0 0 h(y) k(y) 0 0 0 0 1 where y is the current y-coord, to have an effect like bending??? Briefly I'd like to use dynamic matrixes instead static matrices but in opengl I don't know how to do it... someone has any ideas?

Share this post


Link to post
Share on other sites
I think he means the elements of the matrices are depending on the coordinates of the vectors, he wants to transform.
But in what situation is it necessary?
I think you can do it if you use your own vertex manipulation code, and store the transformed vertixes in an other buffer, or use vertex shader.

Edit: by own code I mean: use the matrices as you want, iterate through all your vertexes and transform them.
You are not able to do it in openGL drawing, since transformation calls aren't allowed between glBegin()-glEnd(), and you have to apply individual matrices every vertex. (Although the elements are functions of the vectors' coordinates)

Share this post


Link to post
Share on other sites
yes, it's ok, but if I wont to deform a quadrilater using this 2d equations?

x1=x0
y1=sin(x0)+y0

Normally I use this code:

glBegin(GL_QUADS);
glVertix2f(5,5);
glVertix2f(10,5);
glVertix2f(10,10);
glVertix2f(5,10);
glEnd();

to draw a quadrilater and first glTraslatef(5,0,0) to make a traslation, but in my case? How I do it?

The problem is that I don't know how use current_x or current_y values in my transformation matrix... :(

any ideas?

Share this post


Link to post
Share on other sites

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

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this