C Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming LanguagesC Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
1200+ fellow developers rate and compare features of the top IDEs, like Visual Studio, Eclipse, RAD, Delphi and others, across 13 categories. Enjoy this FREE Download of the IDE User Satisfaction Study by Evans Data Corporation. Download Now!
  #1  
Old February 9th, 2003, 03:28 AM
M.Hirsch M.Hirsch is offline
Contributing User
Dev Shed God 1st Plane (5500 - 5999 posts)
 
Join Date: Oct 2000
Location: Back in the real world.
Posts: 5,969 M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 1 Month 1 Day 22 h 39 m 55 sec
Reputation Power: 184
OpenGL issues

I am really getting on this...

I am doing some fun with opengl. At least trying to. My problem is:
- when i only translate the MODELVIEW matrix, the lights keep static and the room is lit depending on where i am standing. like as if i was carrying a flashlight with me.
- when i translate the PROJECTION matrix instead, the whole output starts shearing and some polygons are clipped unnecessarily.
- when i mix both, i get the same result as with only using PROJECTION matrix.

I´ve read quite many tutorials and books, but could not find a clue what causes this behaviour...

Anyone here got some experience with OpenGL and lighting? My renderer looks like this:
Code:
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
glRotatef(Tilt, 1, 0, 0);
glRotatef(Heading, 0, 1, 0);
glTranslatef(myPosition.X, myPosition.Y, myPosition.Z);

for (....) {
  ... call all renderlists... 
}


The lights are setup only once in my Init() function. I tried to re-setup them in the rendering function, but this would require me to do the vector math to find their position depending on heading,tilt and my position. I doubt this is necessary for OpenGL lighting. Everything else was so easy up to now

Any ideas?
__________________
--
Manuel Hirsch - Linux, FreeBSD, programming, administration articles, tutorials and more.

Reply With Quote
  #2  
Old February 9th, 2003, 08:19 AM
M.Hirsch M.Hirsch is offline
Contributing User
Dev Shed God 1st Plane (5500 - 5999 posts)
 
Join Date: Oct 2000
Location: Back in the real world.
Posts: 5,969 M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 1 Month 1 Day 22 h 39 m 55 sec
Reputation Power: 184
Lightbulb Got it solved.

The concepts of OpenGL are just as whacked as the rest of the programming world

I actually do have to move the lights against the direction that my camera is moving. No idea why they don´t correspond to polygons in that way as i have to redraw polygons in each frame, but lights not ...

Sadly, my framerate dropped from constant 400-410/sec to varying between 160 and 360.
Ok, i´m out optimizing this now

Reply With Quote
  #3  
Old February 17th, 2003, 04:34 AM
lutkebab lutkebab is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2003
Posts: 2 lutkebab User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
OpenSceneGraph

Hi!

If you are in to OpenGL a lot you sholud try the OpenSceneGraph project @ URL

Reply With Quote
  #4  
Old February 17th, 2003, 01:06 PM
M.Hirsch M.Hirsch is offline
Contributing User
Dev Shed God 1st Plane (5500 - 5999 posts)
 
Join Date: Oct 2000
Location: Back in the real world.
Posts: 5,969 M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 1 Month 1 Day 22 h 39 m 55 sec
Reputation Power: 184
Gladly I got the lights issues solved. The drop in framerate was due to a part of the code where was so frustrated that i did reset the lights on each frame and re-setup them then. Seems like the initialization of the lights takes some time. A varying time on my radeon...

Only had a short glance at the page:
"DirectX .x model loader" - exactly what i need for my next step
Are you also using OpenGL?

Thanks for the link.
M.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesC Programming > OpenGL issues


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway