Vector arcade game in LWJGL

Started by scythe, August 19, 2011, 06:58:54

Previous topic - Next topic

scythe

Hey all!  I've been programming in Java for the past four years, yet I am a complete newb with LWJGL.  But I'm willing to learn!  Having said that, any advice you could give me to point me in the best direction would be helpful.

I am coding a vector-based game in LWJGL( think old school arcade games like Asteroidshttp://upload.wikimedia.org/wikipedia/en/1/13/Asteroi1.png, or Major Havoc http://www.appolo.com/Emulators/mhav0003.jpg, or Lunar Lander http://gnm5.tripod.com/images/lunar1.jpg)

My question is, what might be the best way to render the graphics for a vector-based game?  What LWJGL libraries would you recommend I check out?  The thought crossed my mind that I could simply draw the vector graphics in GIMP and use Slick 2D features to import the pictures, but I am afraid that the visual quality would not be as "crisp" as if the vectors were drawn by LWJGL.

Again, any advice would be gratefully received.  Thanks in advance for any help!

princec

Use plain old GL_TRIANGLES, and draw very thin rectangles for the lines, with just a teeny bit of alpha so the corners get a bit brighter like a real vector display.

Cas :)

Fool Running

Quote from: princec on August 19, 2011, 08:58:14
Use plain old GL_TRIANGLES, and draw very thin rectangles for the lines, with just a teeny bit of alpha so the corners get a bit brighter like a real vector display.
You think that would produce better effects then GL_LINES? Looks like a great time to draw with lines to me.
Granted, I'm not 100% sure that lines are supported across all vendors well, but I know NVidia does them well. :P
Programmers will, one day, rule the world... and the world won't notice until its too late.Just testing the marquee option ;D

kappa

Kevglass (Slick2D author) did something similar a while back with just vertex colors, e.g.



 

He describes that he did it as follows:
QuoteKev: I just did what seemed logical, for each line I create a quad with the line across the centre. I set the outer colour to black and the inner to the colour the line wants to be. Overdraw this with a additive blending and a few different shades to build up a glow. Wouldn't really work on sprites of course.

scythe

Wow!  Thanks princec, Fool Running, and especially kappa, I never would have thought a "glow" would be possible with the methods available for line/quad rendering.  You guys rock!  I'll check out those GL methods

princec

GL_LINES are poo. Mostly the ends look crap, and antialiasing is crap. GL_TRIANGLES is the way to go. Also get used to using GL_TRIANGLES and using indexed geometry instead of GL_QUADS because GL_QUADS aren't in OpenGL ES which is where the drivers are all slowly headed.

Cas :)