- November 14, 2011 at 8:32 am #30683
Without modifying the vertices of the objct, how can I rotate or translate the axis or co-ordinate system in openGL ES 2.0 ?
BiplabNovember 14, 2011 at 9:38 am #35220
Translation and rotation in OpenGL ES 2.0 is performed in the vertex shader. For examples on how to do this I’d suggest looking at the training courses that come with our SDK, most of them incorporate some form of translation or rotation.
TobiasNovember 14, 2011 at 10:02 am #35221
Thanks for your reply.
All the translations/rotations done in vertext shaders in SDK are translation/rotation of object. I could not find any example which does axis(not object) translation/rotation.
Please correct me if I am wrong.
BiplabNovember 14, 2011 at 10:17 am #35222
AaronMemberbiplab777 wrote:All the translations/rotations done in vertext shaders in SDK are translation/rotation of object
Not strictly true; in addition to the world matrix, most of our vertex shaders also apply view and projection matrices. In general our demos do most of the interesting things in the World matrix to translate/rotate an object. But you can also apply more transforms to the view and projection matrices.
It’s not obvious what exactly you are trying to achieve by “axis translation/rotation.” However I think you may be able to achieve your goals by applying more matrices to your projection matrix. You could use rotations, or for example you can premultiply it by a matrix to swap the x and y coordinates:
[0 1 0 0]
[1 0 0 0]
[0 0 1 0]
[0 0 0 1]