Jump to content
  • Advertisement
Sign in to follow this  
zorro68

OpenGL vertex and glcalllist question

This topic is 3714 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 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
Advertisement
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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!