CMEngine - a from scratch, modern GL 3d engine

Just wanted to share a recent project that a friend and I have been working on! It’s a 3D engine that’s been written from scratch, that we are trying to use modern OpenGL to render with. Our plan is to eventually make a game off of this. Please lemme know what you think! :smiley: It’s very basic right now as were just trying to get the base of it done. More will come!

https://dl.dropboxusercontent.com/u/31464428/Capture.PNG

(Like i said, very basic)

Any kind of screenshot would help a whole lot with providing feedback, either of how it would look inside a game, or the tools available to create a game :slight_smile:

Mike

I added a screenshot to the original post, like I sad, it’s very basic at this point!

Well, i wonder why your basic shader is scaling everything down?!

I’m not sure, it appears my friend was scaling everything down by a factor of 4…

In Model.java you hardcode a value causing the method “loadModel(location)” to only work if the model is located within “src/main/resources/models”

	public static Model loadModel(String location) throws FileNotFoundException, IOException {
		BufferedReader read = new BufferedReader(new FileReader("src/main/resources/models/" + location));

your OBJ loader is ugly not quite perfect:

  • storing the face indices as a float vertex3
  • doing unnecessary string manipulations (e.g. split)

and not much more to look at

Ah ok, good catch! what would be the best approach to fix this?

Instead of splitting and then parsing the string like I was doing, how would you parse the floats?

instead of doing three times the same split, you could only do one. Or to be even faster (the split operation is a regex match), you could just search for the occurrences of the slash char.

Your OBJ loader is at the moment very, very basic. So be aware that there are many pitfalls, which may trap you.
e.g. I had once the problem that I got OutOfMemory Exceptions for larger models (> 25mb). And the problem was that I created java objects for every little detail of the OBJ format.

Alright, I’ll give that a try! Thanks :slight_smile: