473,511 Members | 10,700 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

OpenGL - Order of transformations

7 New Member
I didn't see a forum for OpenGL so i assume it would go here. I've having an issues with my camera interfering with the transformations of my geometry. Here is my Display() code, I think it's pretty straight forward.

Expand|Select|Wrap|Line Numbers
  1. void Display(void)
  2. {
  3.       glClear(GL_COLOR_BUFFER_BIT |   GL_DEPTH_BUFFER_BIT);
  4.       glEnable(GL_DEPTH_TEST);
  5.  
  6.       eyePos.Set(0,0,10);
  7.       //this is my wrist position
  8.        targetPos.Set(GraspEngine.wsPositions.palmContainerMat[12],GraspEngine.wsPositions.palmContainerMat[13],GraspEngine.wsPositions.palmContainerMat[14]);
  9.  
  10.       //I draw all environment objects here as primitives
  11.       drawEnvObj();
  12.       //Render the hand here
  13.       render();
  14.  
  15.       //get distance to closest primitive, set color to red, and select motion from primitive struct
  16.       GraspEngine.GetDistToEnvObj(&GraspEngine.env);
  17.  
  18.       //reset all transformations and place camera. The PanXYZ variable is a keyboard callback which is set to 0 initially.
  19.       glMatrixMode(GL_MODELVIEW);
  20.       glLoadIdentity();
  21.       gluLookAt(eyePos.GetX()-panX,eyePos.GetY()-panY,eyePos.GetZ()-panZ,
  22.       targetPos.GetX(),targetPos.GetY(),targetPos.GetZ(),
  23.             0.0, 1.0, 0.0);
  24.  
  25.       //output wrist position, it is correct but camera won’t move now.  If I place this at the top then the camera moves but the wrist position is thrown off by this transformation
  26.  
  27. cout << GraspEngine.wsPositions.wristContainerMat[12] << "  " << GraspEngine.wsPositions.wristContainerMat[13] << "  " << GraspEngine.wsPositions.wristContainerMat[14] << endl;
  28.  
  29.       glutSwapBuffers();
  30.       glutPostRedisplay();
  31. }
  32.  

Thanks in advance,

Matt Brisbin
Nov 10 '07 #1
0 951

Sign in to post your reply or Sign up for a free account.

Similar topics

15
4514
by: oracle411 | last post by:
Hi I'm new to OpenGL, but have an OpenGL application written in CPP that I would like to display on a web browser. Was wondering how this could be done? Thank you very much
10
5194
by: Bad_Kid | last post by:
which is better for what?
2
3053
by: pontifikas | last post by:
I've be struggling for a few days to make Opengl work in VS using C#. However, all wrappers I've stambled on(CsGL, CsGL.Basecode,ColinFahey's wgl etc) do not provide sufficient info on how to do...
1
5597
by: Scott Chang | last post by:
Hi All I tried to use the attached OpenGL code to draw a Star-shaped figure on my Microsoft Visual C++ .NET 2002-Windows XP Pro PC. When I did 'Build' in Debug Mode, I got an error C2065:...
14
2632
by: Jessica Weiner | last post by:
I am writing an application in C# which need to plot graphs and simple shapes (polygons, circles, squares etc). Which library is better for this purpose and why? Thanks.
3
9973
by: jg.campbell.ng | last post by:
I'm beginning learning Python and OpenGL in Python. Python fine. But difficulties with OpenGL; presumably with the installation of OpenGL. OS = Linux FC5. Python program gl_test.py: from...
22
2745
by: MC felon | last post by:
hello. i have a Dev c++ compiler (version 4.0). i wish to start on openGL. How do i enable openGL programming in Dev c++? what exactly do i download? assume me to be a complete fresher and please...
9
7493
by: Achim Domma | last post by:
Hi, I'm developing a GUI app in Python/C++ to visualize numerical results. Currently I'm using Python 2.4 with wx and PyOpenGLContext, but there are no windows binaries for Python 2.5 for quite...
1
2950
by: braveheartkenya | last post by:
Hi, I'm new to openGL programming. I'm trying to simulate motion and zooming in and out in an SimpleOpenGLControl from the Tao Framework. <So you'll need to install the framework and put in a...
0
7251
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7367
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7430
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7089
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7517
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5673
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4743
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3217
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1581
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.