Archived

This topic is now archived and is closed to further replies.

TheLabRat

Lots of GL Questions

Recommended Posts

TheLabRat    122
I''m having some strange problems: I got lense flares working last night with gluProject to find the screen pos of a 3D point, and if this screen pos is within the screen bounds, I draw a 2D ortho rect at this point - all works fine - except - the flare is also drawn when I''m facing the opposite way to direction of the flare. I thought the winz coord might be negative if this was the case - but it is 1 if I''m facing the flare, 0 if I''m perpendicular to it and 1 if I''m facing away ("facing" being rotation around the y-axis) How would I get it to only display if it is infront of me? Next, I have a particle model system with multiple particles all spraying out in random directions. This is how I render them: 0)Loadidentity 1)Do camera viewing tranformations 2)loop through all particles 3)push matrix 4)translate to particle pos 5)rotate the opposite direction to camera rotation, so it is perp to the camera 6)Draw a triangle strip quad at new pos 7)pop matrix 8)end loop It works well and looks good until I am faced north (rotated 0 on y-axis) then the particles only travel straight up in a perfect line. Whats wrong? Alpha mask on textures: I''ve got an alpha layer on TGA textures and load them in I put blending on (SRC_ALPHA,DST_ALPHA) or ANYTHING else put on the alphatest with greater than 0.0f and render polys, but their are no see through sections on the textures? What are the correct GL setting for doing this Lastly - how would I build a plane that goes through a triangles edge - for collision detection Thanks a lot - hope someone can help

Share this post


Link to post
Share on other sites
DmGoober    136
Search for something called v-collide. Its a north carolina universities free collission engine. Very easy to use and very very fast. . . commonly accepted in the academic graphics community as being the best/most versatile/most accurate.

Of course, because of its accuracy it may actually run slower than other systems. Make sure to check if it suits your needs as well -- (vcollide runs on polygon soups. Other engines from this same university may run better if you know that all of your objects are convex.)

DmGoober

Share this post


Link to post
Share on other sites