views:

189

answers:

2

I have been assigned the task of simulating the start of the universe using java3D (particles etc) and must consist of 5 different sections... each of a minimal length of 15 seconds. Stages like the particle soup stage - basically 5 distinguishable visualizations. It doesn't have to be complicated, merely spheres moving around with set programmed behaviors.

I have not really done much with java3D other than building a simple fairground ride which relied on Interpolators.

How would I be able to maintain a time line and switch between different stages?

I was wondering how would be best to build this simulation. Would using PositionInterpolator's be suitable for moving particles and detecting collisions? or is there a better way to achieve what i am looking for?

So far I've started to model some particles - simply spheres of different sizes and colours and positioned them randomly within the simple universe and applied a random direction to them with a PositionInterpolator and using a Transform3D to set the rotation.

Any guidance and help would be greatly appreciated.

+2  A: 

How would i be able to maintain a time line and switch between different stages?

Write the main application as a state machine. Treat each stage as a state. Loading the next state after you completed a stage.

This is the state pattern. One advantage of this approach is that you can write each stage as it own mini program thus allowing you to optimize them for the specific visualization you need.

As for the 3D questions it looks like you are in the right track. It hard to answer without doing your homework for you. By separating the application into states you can work on solving the problems of each section without having the work effecting other sections. The only you need to pass around is the handle to your 3D drawing surface.

RS Conley
thank you for your advice, I've managed to split up my code and make it more like a state machine - however i need to find out how to trigger events after a certain time has past. Could this be achieved using behaviors?
Malachi
A: 

Sounds like an rseoul set the assignment for you.

michael mullins