[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1397
  • Last Modified:

OpenGL -- void Display(void) function

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);
terrainRotation();
******************************************************************

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.

Thanks,
EEH
pictureCube.txt
0
ExpExchHelp
Asked:
ExpExchHelp
  • 2
1 Solution
 
trinitrotolueneCommented:
you seem to be stopping redrawing on a mouse button down....??? what is the significance of this?
0
 
ExpExchHelpAuthor Commented:
trinitrotoluene:

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

Thanks,
EEH
0
 
ExpExchHelpAuthor Commented:
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.

EEH
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now