Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Oct 27th, 2006, 10:39 PM   #1
mark
Newbie
 
Join Date: Mar 2006
Posts: 14
Rep Power: 0 mark is on a distinguished road
Opengl problem

Hello i'm trying to get an example in my book working. It is supposed to allow you to move the camera around in a 3d scene. It compiles fine but when i try to run it the window is destorted and i cant figure out why.

there are four files Point3, Vector3, camera.h, and test.cpp

I included them in a zip file and it is attached
Attached Files
File Type: zip project.zip (2.3 KB, 13 views)
mark is offline   Reply With Quote
Old Oct 28th, 2006, 5:43 AM   #2
Klarre
Game engine designer
 
Klarre's Avatar
 
Join Date: May 2005
Location: Sweden
Posts: 301
Rep Power: 4 Klarre is on a distinguished road
The first error is in the function call to glClear at Ln. 70 in test.cpp.
Bad
glClear(GL_COLOR_BUFFER_BIT||GL_DEPTH_BUFFER_BIT);
Correct
glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT);

The second error is in the Camera::setShape function, where the identity matrix should be loaded before you set the matrix mode.
Bad
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
Correct
glLoadIdentity();
glMatrixMode(GL_PROJECTION);

Have a nice day!

/Klarre
__________________
http://www.klarre.se
Klarre is offline   Reply With Quote
Old Oct 28th, 2006, 10:31 AM   #3
mark
Newbie
 
Join Date: Mar 2006
Posts: 14
Rep Power: 0 mark is on a distinguished road
thank you so much that worked
mark is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
OpenGL, SDL, and DirectX Baphomet Coder's Corner Lounge 45 Jul 25th, 2006 12:44 PM
cgi/perl script + IE problem joyceshee Perl 2 Jan 24th, 2006 11:10 AM
OpenGL and Dev-C++ clearbit C++ 4 Jul 27th, 2005 7:58 PM
OpenGL Broax C++ 7 Jul 26th, 2005 6:47 PM
3d OpenGL I need an understanding please? scorpiosage Other Programming Languages 1 Apr 14th, 2005 8:18 PM




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 3:19 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC