Little LWJGL applet demo

Hi, i’ve been trying to learn a bit opengl and i’ve put together a basic demo that uses lights and textured objects with materials and specular. It hasn’t got many fancy techniques, only display lists for the objects. I got tackled down with trying to port different shadow mapping code from c++ cause the matrix calculations get me confused. I hope someone will find it interesting to test.

W,A,S,D,mouse - move
Lights can be turned on/off with keys 1 - 4 :
http://www.hot.ee/testgame/appletloader.html

Cool demo. I just started learning openGL too. I can appreciate how hard it must have been to make! Nice work.

I’m more interested in openGL for fast 2d stuff, and I’ve been browsing the 2 libraries LWJGL and JOGL. LWJGL seems easier and there’s more help out there in terms of tutorials and actually getting started. The JOGL API must have changed a lot over from version to version since most of the examples and tutorials on the net don’t work. Also it’s hard to figure out how to actually build a JOGL app. I don’t understand anything about glugen etc. LWJGL was way easier in that regard. But LWJGL doesn’t have anything from ‘GLU’ which provides polygon tesselation and resizing of windows which is annoying.

What are your ambitions for learning openGL?

Keith

LWJGL has GLU.

Cas :slight_smile:

Hmm ok, shows how much I know.

By the way it’s a nice library, very neat and simple.

I found blog and forum posts saying that in LWJGL you can’t drag the edge of a window to expand it and it doesn’t do polygon tesselation so you can’t draw concave polygons without tesselating it yourself. Maybe that’s not the case in the latest version, I’m still learning.

wrong again :slight_smile:

  1. lwjgl does have polygon tesselation, see lwjgl_util package.
  2. although the default lwjgl Dispaly doesn’t allow resizing, resizable lwjgl window is pretty easy to achieve using a JFrame with Display.setParent() function.

Cool, thanks for the tips. I’ll try and figure it out. :slight_smile:

Thanks Keith i’ve always wanted to create my own little 3d game. I can send you the source of this demo and tell how to set it up in eclipse to get an applet together if you like.

Hey thanks, that would be sensational. my email’s keithphw at hotmail.com I’m very interested to see how you did your demo.

Bump i’ve changed my demo to a more game like demo, it’s looks like a fake minecraft and the physics are kind of unstable cause i haven’t been able to implement simple AA collision detection properly but i think it’s way cooler now.

Pretty neat! :slight_smile:

thats is pretty cool, works and runs really well.

however do get a crash/error dialog on exit, but it appears and disappears so fast that its hard to tell what it is.

even more new stuff, didn’t actually plan to make it similar to minecraft but i added ability to build, destroy blocks it’s quite fun to make something like that
the building is kind of awkard cause im still bad at maths but it works
opengl house lol

http://img213.imageshack.us/img213/5342/68003121.png

i got normal mapping shader working from a tutorial, don’t know if i should put it into demo cause it requires gl2.0 and lots of low end integrated chips don’t support it.

http://img705.imageshack.us/img705/2056/aaaa.png

EDIT: actually its easy to determine the capabilities with (GL11.glGetString(GL11.GL_VERSION).split("\."))[0] and if its 2, then shaders will probably work.

Or use GLContext.getCapabilities() to get a ContextCapabilities object, then check the ContextCapabilities.OpenGL20 flag. This has the advantage of not breaking on the more non-standard version strings that your simple split() probably won’t handle well.

[quote]cause im still bad at maths but it works
[/quote]
You’re not alone. :wink: Many many years have past since I made math and I forgot a lot of things in this domain, but I manage to do with it when there’s a need. Thanks to google, wikipedia, etc. I know this is off topic but just wanted to share it.

Pretty cool. I like the openGL hut :slight_smile:

I’m still plugging away learning LWJGL too. I keep on getting caught up on snags. Like I just spent 5hrs trying to draw a texture in orthographic mode. Damn textures, Grr! For some reason when the image is converted to a texture its height and width change… ??? At least I know now, lol.

Added the normalmapping shader into the demo, with key “t” you can change between shader and non-shader mode.

Intel graphics is just amazing, brand new laptop with intel x3100 runs at 0.9 fps and my over 5 years old pc at 50 fps.

It pauses intermittently on my system; Chrome / Vista / 8600m GT / T7250 CPU…

I havent tried under Chrome, maybe it’s java plugin acts differently.