OpenGL -- void Display(void) function

Posted on 2008-11-12
Last Modified: 2013-12-06
In OpenGL, I'm working on a "picture cube" program that allows me to upload 6 images on a 3D cube.   With a previous version, I utilized XYZ axes to rotate the cube.   Now, I've started replacing the XYZ rotation via a (spinning) "trackball" version.

Both program "XYZ rotation" and "trackball" worked indepdently ok.   Now, having integrated the entire " spinning trackball code" into the "pictureCube" program, I have some trouble getting this to work.   More specifically, the void Display function seems to cause to problems.  

Particularly, the following 3 commands result in the following:  a) images don't show on the picture cube any longer, and b) once I comment out the glTranslate command, a blue cube appears.   Then, however, on mouse click, the cube completely disappears.

glTranslatef(0.0, 0.0, viewxform_z);
glMultMatrixf((GLfloat *) objectXform);

How do I modify the 3 lines below to utilize the spinning trackball functions in the picture cube program?
Pls see attached file for the full source code.

Question by:ExpExchHelp
    LVL 12

    Accepted Solution

    you seem to be stopping redrawing on a mouse button down....??? what is the significance of this?

    Author Comment


    I'm not sure what you're meaning by comment question.   Could you pls clarify?


    Author Comment

    I figured out what the problem was... it seemed to be related to the reshape() function of the original trackball.

    I'll award you the points anyway though.


    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Join & Write a Comment

    Introduction This article is a continuation of the C/C++ Visual Studio Express debugger series. Part 1 provided a quick start guide in using the debugger. Part 2 focused on additional topics in breakpoints. As your assignments become a little more …
    Windows programmers of the C/C++ variety, how many of you realise that since Window 9x Microsoft has been lying to you about what constitutes Unicode ( They will have you believe that Unicode requires you to use…
    The goal of this video is to provide viewers with basic examples to understand how to use strings and some functions related to them in the C programming language.
    The goal of this video is to provide viewers with basic examples to understand how to create, access, and change arrays in the C programming language.

    754 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now