jPCT - a 3d engine for Java => Projects => Topic started by: Crate on March 04, 2006, 02:42:14 am

Title: "Visual" JPCT
Post by: Crate on March 04, 2006, 02:42:14 am
Here is a little project I'm working on. I've called it "Visual JPCT" for lack of a better name. (I hope you don't mind, Egon.)

It's basically a small swing frontend for the jpct engine. I was tired of having to recompile every time I fiddled with my models  :wink: And it is a great way to learn the engine!

(http://www.curious-clocks.net/visualJPCT/screenshots/screenshot_1_tn.jpg) (http://www.curious-clocks.net/visualJPCT/screenshots/screenshot_1.jpg)


I've mapped the following jpct functions to the gui:

Things to be done (some ideas):

I hope you like it so far. If it gets to some sort of solid state, I will release it.

Title: "Visual" JPCT
Post by: EgonOlsen on March 05, 2006, 06:31:13 pm
That's a great idea! I really like it and i think that it will help the engine to get more popular. Is this based on the software renderer only or will you add support for the AWTGLRenderer as well?
Title: "Visual" JPCT
Post by: Crate on March 05, 2006, 06:35:51 pm
I've done some changes to the gui, it now uses JDesktopPane so that I can move and scale windows as needed. Also made some icons  :wink:

(http://www.curious-clocks.net/visualJPCT/screenshots/screenshot_2_tn.jpg) (http://www.curious-clocks.net/visualJPCT/screenshots/screenshot_2.jpg)
Title: "Visual" JPCT
Post by: Crate on March 05, 2006, 06:37:47 pm
thats a good question egon, I'll look into it  :wink:

Edit: Currently I'm using only the software renderer. It does what I need and adding more functionality to manipulate the scene is top on my list. But support for the awtGl canvas would be cool, so it may come a little later.  :wink:
Title: "Visual" JPCT
Post by: OHgaming on March 19, 2006, 10:31:08 am
Hey Crate I think this is a great idea! I've been fiddling around with jPCT as my team and I have been trying to decide what graphic engine to use for our project. I have to say an interface just to add and remove lights and objects from the world would be really useful IMO. I was actually thinking of taking a swing at doing something like this, but now I guess I don't have to  :wink: .

Anyways if you need any help or whatever I'd be gald to help and my team will be very grateful if you get a working version going at all.
Title: "Visual" JPCT
Post by: quixote_arg on March 20, 2006, 01:21:39 pm
No need to wait for a solid state! You can release it and we can all contribute to it
Title: "Visual" JPCT
Post by: Crate on March 20, 2006, 06:58:43 pm
:) thx for the feedback. First release is coming up. There are still some bugs to fix and I want to finish saving scenes, so that it hase some use...
Title: "Visual" JPCT
Post by: Crate on March 24, 2006, 09:35:30 pm
I don't know if anyone cares, but here goes... ;)

Egon asked about the AWTGLRenderer and there is a problem for you, because it uses a heavy weight canvas (lwjgl does, not his fault). Those really don't mix well with Swing.  Look at this: http://java.sun.com/products/jfc/tsc/articles/mixing/ (Guideline  No. 3, for example)

Well, I thought, what else is out there? SWT/JFace.  I found this http://www.eclipse.org/swt/opengl/ and it seems promising, since swt is "completely heavy weight" . You can use lwgjl in swt/jface, so it should work well with jpct - although I haven't tried it. Besides, I like eclipse.

Now I find out SWT doesn't support MDI! Bugger. I like MDI, especially for this application, because it has a lot of different objects to be manipulated and the user could place and size them as he wants.

Now what? If every object gets its own window, the desktop will clutter. Using a big tabbed interface would be very silly for small objects. If each object does get its very own app window, I might as well use MDI and swing again and only pop up the AWTGL in its own window.

I need to sleep over this. If anyone has a sugestion, I'm all ears.
Title: "Visual" JPCT
Post by: EgonOlsen on March 24, 2006, 11:23:16 pm
IIRC, it is possible to mix the AWTGLCanvas with Swing components, i just don't know how. I think that i've seen some info about it in lwjgl forums, but i'm not quite sure where to look for it. Isn't there a kind of "workaround" or "trick" to use heavy weight components in combination with swing!? I've seen some screenshots or "before" and "after"...i just can't remember where it was... :oops:

Edit: Here's something about making lightweight components heavyweight...don't know, if it helps: http://www.javagaming.org/forums/index.php?topic=10697.0
Title: "Visual" JPCT
Post by: raft on March 25, 2006, 12:16:56 am
Crate, why do you plan to use swt instead of awt ? you're true for mixing awt and swing has some problems, but if necessary you can stick to awt. it will run well with AWTGLRenderer as the name implies. life is easier with pure java components.

as you know, the major problem with awt swing combination is awt components are drawn on top swing ones regardless of their z-order. but this doesnt mean you can not use swing features: JLayeredPane (and hence JDesktopPane) effectively layouts and z-orders awt components, which means you can still use JDesktopPane and JInternalFrames for MDI. only titles bars and borders of internal frames will be hidden below awt components. you're working on a helper application, not a commercial one that will go to customer so it doesnt matter so much IMHO. if you care you can still implement your own internal frames on top of awt: basicly they're nothing but dragable and click sensitive components

this is what a thought at a glance

Code: [Select]
r a f t
Title: "Visual" JPCT
Post by: Crate on March 25, 2006, 02:08:52 am
Hi, thx for the replies. I don't want to use only awt because well it does look horrible. And it takes LOTS of work to implement things like a proper tree view without Swing. So its swing or a suitable replacement (like swt/jface).

Yes, it is possible to use heavy weight components with swing. But the options are very limited, especially when the two cross on the z-axis – basically heavy weight will always lie above light weight components. (As an example, the awt canvas will be drawn above the scroll bars of its container, which breaks the whole concept of containers (or JDesktopPane for that matter))

As opposed to swing, swt/jface doesn’t have those problems because all components are drawn by the operating system anyway, so all components are “heavy weight”, in the awt/swing sense. Since opengl works like that anyway (machine not java drawn), one seems to be predestined to combine  swt/jface and lwjgl (for rich gui stuff). But then I really wanted to use MDIs, which swt/jface don’t handle at all. (And the swing implementation is very limited.)

On a whole I tend to discard the whole MDI concept (read a lot of criticism) but still stick to swing because I’m used to it. I will use the software renderer as a preview and popup an awtcanvas in a new window when the user wants one. Then Windows can sort out the problem and not me :)  It seems like the best trade-off to me at the moment, I’ll show you how it goes ;)
Title: "Visual" JPCT
Post by: Crate on March 26, 2006, 05:45:42 pm
If you’d like to have a look at the work in progress, here is a first early beta.

VisualJPCTv0.1Beta.zip (http://www.curious-clocks.net/VisualJPCT/VisualJPCTv0.1Beta.zip)

You can’t do much, but I am very proud of the undo/redo :)
Unzip and it should run. All apis are included in the zip. (oh, and its jave 5 stuff)


import md2s
move/rotate camera
move objects
load/save scene
undo/redo object opperations

have fun  :P
Title: "Visual" JPCT
Post by: OHgaming on March 27, 2006, 05:19:15 pm
Hey nice work so far!

I would suggest making it so 3ds files can be imported since that is what I use for the most part. I would also include a demo map or something with the release, but that's not a big deal. I can just go download some md2 files.

Also I would suggest adding shortcuts for the undo/redo functions. Again, not a big deal though and you might have already done it, but as I'm typing this I haven't had a chance to mess with a scene on this program yet.

Anyways this is looking very nice, espcially for a first release. Good luck, and I can't wait to see the next release.  :D
Title: "Visual" JPCT
Post by: Crate on March 28, 2006, 05:54:28 pm
Thx for trying it out! I've just finished a new version. You can get the new jar here:

VisualJPCT.jar (http://www.curious-clocks.net/VisualJPCT/VisualJPCT.jar)

Just copy it over the jar from the zip posted above. The external apis remain the same, but are needed - so get the above zip if you don't have it yet.

New features:

Import .3ds files
Changed scene save/load to enable saving/loading objects based on .3ds
Object rotation is in
Added menu mnemonics and accelerators for the guys at OHgaming :wink:

Again - if you have any suggestions, they are very welcome.
Have fun!
Title: "Visual" JPCT
Post by: Remo on March 28, 2006, 07:34:12 pm
Nice work on that :D.

Will it come with an animation window also?
Title: "Visual" JPCT
Post by: Crate on March 30, 2006, 05:57:11 pm
animation is coming - maybe.

I'm adding features as I need them, currently I want to be able to create objects by adding/removing triangles.

When I need animation, I will try and put it in, but that will be a big task, since animation is quite a complex thing.
Title: hmmm
Post by: necromancer on March 31, 2006, 02:25:59 pm
maybe may sense not add animatino on 1 file
but create some files
so you have: pers.3ds and got pers1.3ds and so on.
Title: "Visual" JPCT
Post by: Crate on March 31, 2006, 07:59:42 pm
I'm not 100% sure I know what you are trying to say...
Title: "Visual" JPCT
Post by: luispablo on September 07, 2006, 05:16:32 pm
The download link seems to be broken...
Where can I get it to give it a try?
Title: "Visual" JPCT
Post by: Crate on September 26, 2006, 01:01:23 pm
Hi, sorry I'm currently very stuck with my daytime job. ;) Currently the server is down. I will repost a link as soon as I get proper web-space and add a new version as well.

Title: "Visual" JPCT
Post by: EgonOlsen on September 26, 2006, 11:14:42 pm
Great to see that you :wink:  /the project are still alive.
Title: "Visual" JPCT
Post by: saboteur on November 04, 2006, 06:20:15 am
Hi Crate,

Sounds like a great idea, any idea when you'll be putting the file back up for download?