Results 1 to 2 of 2

Thread: Java help - please!

  1. #1

    Default Java help - please!

    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)

  2. #2
    i n v i s i b l e Tech Admin o_O's Avatar
    Join Date
    Jun 2001
    Location
    New Zealand
    Posts
    2,957
    Blog Entries
    1

    FFXIV Character

    Humphrey Squibbles (Sargatanas)

    Default

    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.

    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •