Need help on basic transparency and lighting in GLUT...

Started by
-1 comments, last by ahmadka 17 years, 1 month ago
Hi Guys !! This is my first post here, so please help me out people...:D I have recently started learning GLUT, and have been on a mission to create this scene in GLUT....I have gotten about half way though, but now I am facing some serious problems....please hear me out... I am trying to create this image in GLUT: http://img230.imageshack.us/img230/5546/df2id5.jpg Now, I have done some work on it already...like the background gradient (going from white to purple)...I loaded a texture for that...actually I tried to implement it though lighting, but that didnt work for me... Basically, the two major problems I am facing now are these: 1) I dont quite know how to create clouds that are in the bottom half of the picture..... I thought of using clouds 'layers'... Here is the basic idea I thought of: a) I make some cloud textures in photoshop b) I load these textures in GLUT c) I tell GLUT to make the cloud 'layers' transparent, based on the texture color at a specific pixel..If its 100% white, then it should be completely transparent...if its a light blue colour (like in the picture above), then it should be opaque....I dont know how to implement this in GLUT though... 2) The second question I have is this: Can lighting be only used on 3D shapes ? Can't it be used on 2D shapes like GL_QUADS, GL_POLYGON ?? I can get light to fall on 2D shapes like GL_QUADS, etc...but I canNOT get the light to distribute on the *un*evenly...What I mean to say is that, the light just spreads out on the surface of GL_QUADS uniformly eveywhere....whereas it should actually be brighter on areas nearer to the light source (like in real life)... If someone can show me how to use proper lighting on 2D shapes like GL_QUADS, I would be really greatful... Also, here is my project (not finished though): http://rapidshare.com/files/21504891/Undertaker.rar

This topic is closed to new replies.

Advertisement