PDA

View Full Version : Java help - please!



ThePheonix
12-29-2005, 01:48 AM
I'm staring on my final project for programming, and we're planning to make an RPG (It's a group project, and we already decided).
I'm planning to use parallel programming (the one when you have multiple computers working on the same program together) - I'm looking into JPVM

I may also try 3D Java... If anyone can give directions.

Does anyone have any experience with any of these?
Any and all comments and sujestions are welcome! (please)

o_O
01-03-2006, 06:18 AM
If you don't know 3D Java already, then it's possibly a bit too much to learn just for one assignment. It has an entirely different API to regular Java, as it has to deal with perspective itself.
The way it works is to create a separate "universe", which is an object in itself, and you construct the universe with one or more vanishing points, and the Java will work out the perspective itself, if you move an object forwards or backwards in the horizontal plane.

I found it much easier to code a 3D engine myself, using Java 2D. Here's a very watered down idea of how it works:

First I have an interface coded with all the methods I needed for the rendition of objects (rotate and translate were the main ones).

Second, I coded a class which implemented my interface.
The constructor accepted an ordered array of integers (x and y coordinates ordered such that they could be successively joined from beginning to end to render the shape), and calculated the correct positioning based on where they need to be in perspective.
The most important thing about this class was that every point of every object is always calculated by a certain sine function, with the centre of the screen as the normal.

Note that you'll need to know or learn calculus and advanced trigonometry in order to make this sort of thing work. :p

My objects were all classes coded such that they had a getPoints() method, which returned the ordered array of its own points.

Lastly, everything was controlled from my actionPerformed() method. It's not the fastest code ever, but for all intents and purposes, it was definitely sufficient for an action game, so for an RPG it should be fine.
Hope that's not too jumbled up and weird to understand. :p