Simulation Project and some Questions about LWJGL Features

Started by fm27, June 27, 2012, 19:37:42

Previous topic - Next topic

fm27

Hello Community!

I am working on a scientific thesis these days and I want to develop a simulation-software for small robots (lego mindstorms) driving, orientating and communicating inside a virtual 3D environment. These robots shell have actors (to perform their movement in the scene) and sensors (for their orientation in the scene).

I am a real newbie in writing simulation-programms and I have not  written a 3d-Game so far, but I want to use a 3D-(Game)-Engine/Library for my work and I am searching for an appropriate one.

1. Is is possibile to create a virtual 3D Environment including placing the robot, placing objects and texturing floor, walls and arbitary scene objects (at runntime) using LWJGL?

2. Is it possible to read values from the scene for example with LWJGL... for example
-- the color and brightness of the object which is in front of a robot
-- the distance to the next obstacle

3. Is is possible to manipulate the scene at runtime - means changing position and state of objects and robots?

4. Has LWJGL built-in collision detection (collision detection between robots and obstacles should be possible.)

5. Has LWJGL built-in physics like gravity, friction and idleness/inertia?

6. Is it possible to save the state of a scene and to load it later?

7. Are there useful tutorials or a textbook?

Do you think LWJGL would be a good choice?

Thanks in advance!

CodeBunny

I'm going to go out on a limb and say you should not be using vanilla LWJGL for this, especially if you need to be productive and get a thesis together.

LWJGL is very, very minimalistic and low-level. All it does is let you make OpenGL calls from within Java - everything else you need to build yourself. So, if you wanted to just use LWJGL, you'd need to put together a whole graphics engine, physics system, load/save protocols, input system, etc. That will take a lot of time, especially if you have no prior experience.

My advice: use a game engine based on LWJGL. My suggested one would be the Java Monkey Engine - it's a fully featured, 3D java game engine with support for physics, advanced rendering, etc. Their website is here: http://jmonkeyengine.com/

matheus23

I agree with CodeBunny. You should first go with a higher-level engine like the JMonkeyEngine.

But beside. I have myself participated at the FLL. I'm not sure, what you want to archive... Normally the robot moves much different than expected. There are lots of little inaccuracys. It is impossible to simulate where the robot would drive.

Also, it is almost impossible to simulate the physics. Every little piece of lego in that robot makes it flexible. Simulating somthing like that is a masterpeice.

And lastly, it would be a lot - no, A LOT of work to model that robot made of legos. Just remember, that you will never get a simulation program doing something better than the reality ;)

If you don't want to do this to simulate something, and you more want to learn 3D graphics, I'd go with the JMonkeyEngine, or - if you are an advanced Java programmer - maybe with LWJGL or JogAmp.
Doing physics can then be done with JBullet (java port of the Bullet-engine (bullet physics engine library)), or with JBox2D (java port of the Box2D engine (only for 2D graphics)).
My github account and currently active project: https://github.com/matheus23/UniverseEngine

CodeBunny

It wouldn't actually be impossible if he didn't exactly model the robots, simply used approximate models. I agree, if you're supposed to make a system that can have any lego robot designed in it, and then needs to simulate the functionality of the robot, that's a multi-year project and you need to stop now. But if you're allowed to use predefined lego robots and simplify their physics representation, then you won't have to deal with the really crazy stuff that will eat up the months. Simulating sensor input on a predefined physics model is a solvable problem.

As a piece of example software, take a look at Webots: http://www.cyberbotics.com/. I work with it, so I'm decently well acquainted. It's really not a "good" piece of software (the interface is really bad, the workflow isn't streamlined, and it could be better in a lot of ways), but it may be a good template for what you want to do.

One final warning: if you're not a very good programmer, I'll be blunt: you're setting yourself up for failure. This is a very complicated programming project you're tackling, and will take a f*ckton of work for experienced people who already know how to program this stuff. If you have any other thesis project you could pursue, I would recommend it.