Skip to main content
gamedev.net
🔒 Locked

Drawing objects dynamically?

Started by JasonDav May 20, 2003 at 2:28 AM 4 replies 450+ views
Original Post
JasonDav
JasonDav
Is this possible? I have a village with a sun rotating around it. The rotation is controlled by a variable ''angle''. When 90<''angle''<270 I want stars to appear. I have tried putting the code for the stars after the if condition, but with no success. How does openGL handle this dynamic drawing?
Basiror
Basiror
that seems to be a programming question and doesn t have to do with opengl


damn dude do your homeworks there are enough basic c++ programming tutorials/articles on this page
http://www.8ung.at/basiror/theironcross.html
JasonDav
JasonDav
It has nothing to do with programming and everything to do with openGL DUDE.
The problem is that openGL wont dynamically draw my object when the variable has a certain value.
If you cant help me, then theres no need for your uncalled for comments DUDE.
VolkerG
VolkerG
Well, I don''t think that anybody can really help you, if you don''t provide us with more details (code for example). And by the way, I don''t think, too, that the problem has to do with OpenGL, but that''s not the point.
iNsAn1tY
iNsAn1tY
Well, you've written a three line description of your problem (not very detailed or easy to understand, either), and expect someone to come up with an answer to your problem. Well, at a guess:


  
if((angle >= 90) && (angle <= 270))
{

DrawSky(TEX_STARS);

}
else
{

DrawSky(TEX_SUNSKY);

}


What are you actually trying to do? Do you want the sun to set, and the stars to appear? This takes some very clever programming. If you use the above code, the sky texture will simply switch at 90 degrees to stars, and switch back to the Sun at 270 degrees.

If you want a gradually setting Sun, which gives way to the Moon and stars, then rises again, there are tutorials out on the net for just this. However, it is somewhat complex, and I think you'll need to know about OpenGL's texture matrix. Try Google.

Please give us a through description of your problem, then we can help...



Coding Stuff ->  [ iNsAn1tY Games | DarkVertex | How To Do CSG | Direct3D Vs. OpenGL | Google ]
Fun Stuff    ->  [ Evil T-Shirts | Stick-Based Comedy | You're Already Here | The Best Film Reviews ]


[edited by - iNsAn1tY on May 20, 2003 9:16:55 AM]
My opinion is a recombination and regurgitation of the opinions of those around me. I bring nothing new to the table, and as such, can be safely ignored.[ Useful things - Firefox | GLee | Boost | DevIL ]
Ilici
Ilici
it''s nothin to do with OpenGL i think. ur just doing smth wrong.

to get a nice sensetion for the sky do this:
- make a table which stores how much the sky is transparent at a given hour (get the time from the sky angle)
- draw the stars
- use that value to blend the sky over the stars

the term u used "dynamic drawing" its kinda strange. if u draw everything each frame that makes the whole rendering dynamic right?

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.