Jump to content

  • Log In with Google      Sign In   
  • Create Account


docpunk

Member Since 22 Jan 2011
Offline Last Active Jul 06 2011 07:44 AM

Topics I've Started

[java] How do I load resources for Web start?

22 June 2011 - 05:21 AM

I'm trying to get my first game type thing working with webstart.

At the moment my program appears briefly as a black screen and then shuts down straight away when I use webstart.

I'm quite sure i've got the security signatures, jar files and jnlp file right. As they probably would of popped up as exceptions.

I'm quite confident the problem is most likely loading resources:

fManager.loadSectorTypes("sectors01.txt");
fManager.loadLevel("level2.txt");
texture[0] = TextureLoader.getTexture("PNG", new FileInputStream("stonewall02.png"));
texture[1] = TextureLoader.getTexture("PNG", new FileInputStream("stonefloor01.png"));

Those are examples of the lines that load the data in my program.. Worked fine in netbeans with the files in the project folder.

What do I change these lines to, and where do I put them in relation to my jar files to get it working properly?

I've read that it could be Resources.class.getClassLoader().getResource("path/to/logo.png"); however i'm not sure where the Resources object is.

Thanks for your help!

Need help with Voxels (depth testing etc)

20 June 2011 - 09:54 PM

Hi guys thankyou for the help.

Inspired by an indie game coming out called Voxatron I decided to mess about with voxels.

Basically what I've tried is first making a plain colored quad's verticies into a display list.

Then I nested 3 for loops. 100x 20y 100z and drew each quad offset by by its xyz position.

It was pretty awesome when I was looking at a slab of 200,000 voxels, however it was only getting about 5-7 FPS as you'd probably expect because it was rendering every quad.

I'm wondering before I persue some sort of depth testing. does GL11.glEnable(GL11.GL_DEPTH_TEST); automatically take care of that? If so, I'm definitely using it wrong, otherwise
I'm going to try and figure out a way to determine which ones are visible.

Do you think doing pushmatrix + popmatrix will assist with doing this faster?

Thanks for that.





Lesson 10 is all MODELVIEW. How can i change?

18 June 2011 - 03:00 AM

I was very proud to get lesson 10 working in LWJGL and its now working as presented. I'm now trying to learn how to place objects in the world and rotate them individually and independently from the world.

Based on what I've read with openGL. That is what the distinction between MODELVIEW and PROJECTION matrix modes is for.

Lesson 10 seems to rotate the entire world as one big model with MODELVIEW. So what i'm confused about is if I was to attempt to add a quad to the middle of the level and then rotate it with glRotatef that would rotate not only the quad but all of the walls, floors and everything else that is part of the scene. Not just the quad like I would like to try and do.

Since the heading and looking angle appear to be taken care of only by the below two lines:


GL11.glRotatef(lookupdown, 1.0f, 0, 0);
GL11.glRotatef(sceneroty, 0, 1.0f, 0);

I thought a good solution would be to change them to this:

GL11.glMatrixMode(GL11.GL_PROJECTION);


GL11.glRotatef(lookupdown, 1.0f, 0, 0);
GL11.glRotatef(sceneroty, 0, 1.0f, 0);
GL11.glMatrixMode(GL11.GL_MODELVIEW);

However this causes the level to look normal at first but if I try to do anything that involves rotating it makes the level start spinning out of control.

Any idea how I can conquer this one? Thanks a lot I do appreciate the help.

Where can I learn to make a 3D Voxel engine? Java.

22 January 2011 - 08:53 PM

How's it going?

I want to learn to make a 3D Voxel based engine quite similar to the upcoming game Voxatron.



I've googled the topic for a very long time now and while I've learned a lot about voxels and plenty of people have showcased what they've done I just cant seem to find a guide that deals with programming a 3D engine like this from start to finish. I am quite proficient in Java but have not attempted to use openGL which I imagine is what I'd be using for something like this.

If one wants to program a 3D engine as per the above youtube video. What books and guides would be the best?

PARTNERS