3D Randomly Generated World

Hmm. Just tried it on my mac (has support for 3.3) and got the same error as Simn. I don’t know how to fix this error because it doesn’t seem like anything is wrong. If anyone has any idea, could they please share. I will continue trying to find the cause of this problem on my own.

@Wessles
I don’t think that creating a fat jar will solve any problems. The problem is not locating the files.

If you’re using [icode]System.getProperty(“user.dir”);[/icode] you will get errors if you try to double-click launch on Mac/Linux.

Solution:


	public static String jarDir()
	{
		try
		{
			return new File(SomeClass.class.getProtectionDomain().getCodeSource().getLocation().toURI()).getParent();
		}
		catch(URISyntaxException e)
		{
			e.printStackTrace();
			return null;
		}
	}

Yeah, it appears I am having the same issues in mac too… :confused:

I thought

new File(SomeClass.class.getProtectionDomain().getCodeSource().getLocation().toURI()).getParent();

was a joke the first time I read it, but apparently it’s legitimate. Java’s such a complicated and bureaucratic platform - maybe that’s why companies like it?

Could you make a version for those of us with OpenGL 3? #130 for shader

Thank you!

@Zeke

There you go. Link in the 1st post :wink: I tested it to the best of my abilities on an opengl 4.3 computer so I am interested in your feedback. :smiley:

Log file:

Using Java Version: 1.7.0_45
OS: Windows
Using OpenGL Version: 3.0.0 - Build 8.15.10.2291
Loading Texture: grass13.png

Status: Works great! :slight_smile:

Thanks for fixing that. That is really awesome. Is the code on github?

Also, do you use matrix transforms for camera? It seems like it… I really want to learn to get away from that, never learned to use quaternions… really want to.

@Zeke

Thanks for the feedback!

Check out my signature for my github page.

The base engine is a modified version of this tutorial, written in LWJGL. There are dedicated camera and quaternion classes that you can check out if you feel the urge.

[V 0.0.3]
-Text Rendering!
-Spritesheets/Texture Regions!
-Press ctrl to zoom!
-[] to decrease and increase render distance!

[V 0.0.3.1]
-Text Rendering how I intended it!
-Opengl V: 3.0 crash fixed!
-FPS counter!
-Hold Q to fly supersonic!

The world is collapsing!

Look at that implosion :smiley:

Still works for me.

Question 1: Why not use Quaternions for camera? - or if you have, it is not working properly.

Question 2: Where is this going? Do you have an end game?

Also, super sonic can get me off the map fyi.

@Agro Thanks :stuck_out_tongue:

@Zeke Yeah, the camera is a bit fragile at the moment. I might look into it and redo the code. No end game at the moment as this just started off as a simple example for simplex noise. If you have any suggestions, I would love to hear them! I fixed the supersonic problem, but it won’t be in the jar until the next release.

This is some really cool stuff! :smiley:

Thanks HenBagel!

Sorry about no developments for a while. School is brutal now and the huge increase in homework has left me no time to work on anything. I plan on trying to make time in the near future to work on this project some more.

Any new developments on this project?

Are you in college?

I have a minor bug fix that I haven’t uploaded yet, but nothing major. I hope to be able to start this up again very soon.

Yes

You should get back to this when you have spare time, nice hill generation.

How flexible is it? Are you able to control the height easily? Never done this before, interesting to know how flexible a simple implementation of this is.

I am using simplex noise to generate.

I don’t really know where I got this code from but it works perfectly.
SimplexNoise class
SimplexNoise_octave class

Using these classes, I can easily generate a series of points, which are later used to create a mesh.


// largestFeature is how often the max and min values are reached (I think)
int largestFeature = 100;
// persistence is how random the points are (while increasing the max and decreasing the min)
float persistence = 0.2f;

SimplexNoise noise = new SimplexNoise(largestFeature, persistence);

// This is used to just create larger features.
float multiplier = 20f;
// Used to move all the points higher or lower
float heightOffset = 0;

// Stores a 2D array of points using the simplex noise.
for(int i = 0; i < map.length; i++)
	for(int j = 0; j < map[0].length; j++)
		map[i][j] = new Vector3f(i + x, (float)noise.getNoise(i + x, j + z) * multiplier + heightOffset, j + z);

// Mesh generation goes here.

You can check out the source code on github to see how I implemented it. (under com.longarmx.smplx.world)

Update V0.0.4 is HERE! (finally)

[Change Log]

  • Fixed supersonic bug
  • Added grass patches
  • Added slow walking

Download is in the OP