Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (538)
Games in Android Showcase (132)
games submitted by our members
Games in WIP (601)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Mix 2D and 3D in games  (Read 2970 times)
0 Members and 1 Guest are viewing this topic.
Offline Dreamage

Junior Newbie




On the fifth day, God creates Java


« Posted 2003-01-11 19:02:59 »

I'm just thinking to start a game project and I want some advices. I want to use pre-rendered 2d backgrounds but 3d characters. Is it possible to do this using Java3D or should I have to find a way to display my 3D characters using Java2D ?

Do you know some engine that could help me with that kind of stuff ?

Any advice are welcome since I'm a beginner in 3D environnements.
Offline zparticle

Senior Devvie




Thick As A Brick


« Reply #1 - Posted 2003-01-12 03:12:02 »

are the 3d characters only moving in the x and y planes or do they move in the z as well? If only x and y then why not pre-render them as well and go fully 2d?

Offline Herkules

Senior Devvie




Friendly fire isn't friendly!


« Reply #2 - Posted 2003-01-12 07:59:55 »

Also possible with Java3D. Look out for classes around Raster, OrientedShape, Background....


HARDCODE    --     DRTS/FlyingGuns/JPilot/JXInput  --    skype me: joerg.plewe
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Dreamage

Junior Newbie




On the fifth day, God creates Java


« Reply #3 - Posted 2003-01-12 12:51:40 »

Yes, the 3D characters must be able to move on the z axis and get smaller or bigger when moving on this axis.
Offline Breakfast

Senior Devvie




for great justice!


« Reply #4 - Posted 2003-01-12 19:35:54 »

I would definitely look to use Java3D for this- it is not so easy to get started, but you will be able to get exactly the kind of effect you are looking for. I'm thinking something along the FF7 or Resident Evil avenue?
Offline Dreamage

Junior Newbie




On the fifth day, God creates Java


« Reply #5 - Posted 2003-01-13 17:32:06 »

FF7 is exactly what I had in mind. Is anybody aware of some good tutorials to begin with Java3D ?

Also, do you think that GL4Java is a better alternative that Java3D (for performance) ?
Offline Herkules

Senior Devvie




Friendly fire isn't friendly!


« Reply #6 - Posted 2003-01-14 04:35:09 »

Quote
Is anybody aware of some good tutorials to begin with Java3D ?


Start with the samples, research the code at j3d.org.

Quote

Also, do you think that GL4Java is a better alternative that Java3D (for performance) ?


As long as your app is simple, GL4Java might be faster for it's a low-level API. The more complex it gets, the more code you'll have to write yourself and the more the initial benefit will vanish.
(Depending on what you intend to do, this does not have to be true, but it's likely to be)

HARDCODE    --     DRTS/FlyingGuns/JPilot/JXInput  --    skype me: joerg.plewe
Offline Captain-Goatse

Junior Devvie




I suck at teh 2D. XBOX IS BIG LOL!111


« Reply #7 - Posted 2003-01-14 07:53:48 »

Quote

As long as your app is simple, GL4Java might be faster for it's a low-level API. The more complex it gets, the more code you'll have to write yourself and the more the initial benefit will vanish.
(Depending on what you intend to do, this does not have to be true, but it's likely to be)



What are you saying here? GL4Java works on lower level than Java3d always and I can't see how the complexity of code will affect the speed of GL4Java, which initially is the benefit along with the immediate mode, unless you have other justification for GL4Java's speed, that is.

Does not compute, please explain better.

Also, due the fact that OpenGL has generally bigger fanbase than Java3d, which initially is dependent on OpenGL has helped me to generate code many times faster. Also the fact that OpenGL has big communities unlike java3d helps since you can go ask around there.

I don't want to turn this into flamefest, but Herkules is Java purist, which in my opinion makes him little bit blind. It is not a bad thing of course, but I suggest you try both before judging which one is better.
Offline Herkules

Senior Devvie




Friendly fire isn't friendly!


« Reply #8 - Posted 2003-01-14 08:19:29 »

Of course, the speed of gl4java itself doesn't change.

But the more complex the overall engine gets, the more stuff will be necessary to do all the approp. sortings (material, spatial, ....), implement the approp. culling mechanisms, implement things like transparency sorts CORRECTLY and efficiently, allow for efficient collision detection/picking, make effects not stall the pipeline, integrate the sound into the spatial structure ...............

There a real lot of things to do getting from a rendering API to a true 3D engine. Most of them are not that much needed my simple games, more are needed for more complex games.

For myself I can say I know quite good about 3D technology from my days when I was young, but I am very sure that the Sun guys are far ahead of myself!

No, I'm neither blind nor a purist. I just know that if I felt I'd better use naked OpenGL, I'd do it in C or C++. Just for the reason you mention: then I could use all the things around for OpenGL.

I just see it the other way round. I don't start with wanting to use Java, then look for a 3D API. It's more that I see the great Java3D API (together with a great network API, a good GUI API, a good memory management system) and then feel comfortable that I can use Java with it.

For me, exploiting a well-behaved, powerful system where I feel that real experts built it is just pure fun. Implementing bounds determination and frustrum culling is NO fun. Did it before. Sucked.

HARDCODE    --     DRTS/FlyingGuns/JPilot/JXInput  --    skype me: joerg.plewe
Offline Breakfast

Senior Devvie




for great justice!


« Reply #9 - Posted 2003-01-14 11:58:21 »

I fall on the J3d side here too- I would say that if you don't already understand OpenGL then there is probably not a lot to gain by using one of the java-ogl interfaces. You can do all the same stuff with J3d and if your world is not immensely complex I can't see there being any noticeable difference at all.  If it is, j3d may well be better.

I would definitely look at Selman's java3d book and the sun tutorials to start with. There is also some good stuff at j3d.org for specific areas, and people here are always willing to give advice.

Unfortunately there is something of a dearth of basic tutorials to follow those up but people here and on the java3d-interest mailing list are helpful and very well informed, even if half of them will tell you you were wrong to use that API (whichever you choose) and you should have burn everything you own, forget everything you thought you knew and move to the mountains to be a hermit. Or at least change to GL4/lwgl/j3d/etc Smiley

I would agree with herkules that if you use Java3D you will be able to get into the interesting bit a whole lot sooner, unless you find really complex maths really interesting.
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline princec

« JGO Spiffy Duke »


Medals: 430
Projects: 3
Exp: 16 years


Eh? Who? What? ... Me?


« Reply #10 - Posted 2003-01-14 15:28:46 »

Actually I found learning the maths really very interesting indeed, and I felt a great sense of achievement in getting things to work as expected when, honestly, I don't really know anything about 3D graphics.

It's also led to that deep understanding of things that you only get by looking under the hood and doing it yourself.

Cas Smiley

Offline Captain-Goatse

Junior Devvie




I suck at teh 2D. XBOX IS BIG LOL!111


« Reply #11 - Posted 2003-01-14 15:57:08 »

I noticed the same excact thing as Cas, the deeper understanding.

At first I was like wtf give me back transform3d, but once I got into it I never wanted to look back. There is just... so much potential in openGL, which I fail to see when I look at java3d. It is not that java3d is just restricted, but also that you can't do everything yourself.

Besides the math isn't that hard. Doing 4x4 transform matrices should be a cake for anyone who has taken math in the university/college. Trigonometry, matrices, little transformations of functions, which you will see in 2d anyway. Not that hard at all.

In fact when I started with java3d it took me longer to get to this stage than with opengl. I admit that I'm not still fluent with opengl, but I'm going strong.  


Offline Breakfast

Senior Devvie




for great justice!


« Reply #12 - Posted 2003-01-15 12:41:56 »

Quote
Besides the math isn't that hard. Doing 4x4 transform matrices should be a cake for anyone who has taken math in the university/college.

What about those of us who did Philosophy?   Cry
Offline swpalmer

JGO Coder


Exp: 12 years


Where's the Kaboom?


« Reply #13 - Posted 2003-01-18 20:50:14 »

Quote
What about those of us who did Philosophy?


I'm afraid there is no hope for you. Cheesy

Offline Herkules

Senior Devvie




Friendly fire isn't friendly!


« Reply #14 - Posted 2003-01-19 15:41:40 »

Captain-Goatse, I have the feeling that you are not really aware of whats lying in front of you....

HARDCODE    --     DRTS/FlyingGuns/JPilot/JXInput  --    skype me: joerg.plewe
Offline gcollin

Senior Newbie




Java games rock!


« Reply #15 - Posted 2003-01-20 09:23:26 »

You can mix Java 2D and 3D anyway you like (with java3D).
I do this for a space game.
The starfield background is simply a picture drawn in Java2D before the 3D.

If you want your 2D to be behind the 3D stuff, use
  Canvas3D.preRender()

if you want 2D to be in front of 3D, use
  Canvas3D.postRender().

Hope this helps.
GĂ©rard
Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

rwatson462 (29 views)
2014-12-15 09:26:44

Mr.CodeIt (20 views)
2014-12-14 19:50:38

BurntPizza (42 views)
2014-12-09 22:41:13

BurntPizza (76 views)
2014-12-08 04:46:31

JscottyBieshaar (37 views)
2014-12-05 12:39:02

SHC (50 views)
2014-12-03 16:27:13

CopyableCougar4 (47 views)
2014-11-29 21:32:03

toopeicgaming1999 (114 views)
2014-11-26 15:22:04

toopeicgaming1999 (102 views)
2014-11-26 15:20:36

toopeicgaming1999 (30 views)
2014-11-26 15:20:08
Resources for WIP games
by kpars
2014-12-18 10:26:14

Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-09 22:35:00

Definite guide to supporting multiple device resolutions on Android (2014)
by mbabuskov
2014-10-02 22:36:02

List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!