Sign in to follow this  
zorro68

OpenGL vertex and glcalllist question

Recommended Posts

Hi, I make a cube into a list (glNewList, glEndlist....) with 8 vertex. Then before render the cube I want to modify the position of these vertex (for example to rotate the cube, but I don't want to use glRotatef, matrix, quats,....) and then render the "modified" cube. Is there any function in OpenGL to get the vertex of the object, for example, something like this: GLuint create_cube() { glNewList(); ... glBegin(); ... glEnd(); glEndList(); } void Draw() { ... id=create_cube(); //id is a global variable ... } void Render() { ... glCallList(id) ... } void modify() { ... getVertex(id); //something like this modifyVertex .... glCallList(id) or Draw()//plot the modified cube ... } Thanks in advance

Share this post


Link to post
Share on other sites
If you want to transform the vertex yourself, then you shouldn't use display list because they are static.
To transform the vertex yourself, you can use glhLoadIdentityf2, glhTranslatef2 and the other functions available to built a matrix.
To transform th vertices by using that built matrix use glhMultiplyMatrixByVector4by4f_1 or one of the similar functions

glhlibrary.html

Share this post


Link to post
Share on other sites
Thanks V-man, but is there any way without using external libraries, only with OpenGL and GLU libraries?

Thanks

Share this post


Link to post
Share on other sites

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