Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (754)
Games in Android Showcase (229)
games submitted by our members
Games in WIP (842)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
   Home   Help   Search   Login   Register   
  Show Posts
Pages: [1]
1  Java Game APIs & Engines / Java 3D / Re: ASE Loader on: 2005-04-13 20:14:31
ASE does support animation, keyframe animation that is. The ASE exporter can be set to export animations in the export-options-panel. I didn't use that though. The way I did it is that I have exported one .ASE-file per frame. If you have downloaded the gordon-demo, you'll see that it has a lot of .ASE files in the gordon-folder. Quite simple, and a complete diskspace-eater Smiley To make the animation look somewhat smooth and to cut down on required .ASE files, I use a simple linear interpolation between the frames.

If you need your own file-format, I'd recommend taking a quick look at MAXscript, as it was surprisingly easy to export a scene using it. That way you can export animations etc just the way you want without all the unneeded info you don't need. In fact, if I had taken a look at MAXscript before I started doing the .ASE loader, I probably never would have made it using ASE, but rather a custom format.

I have uploaded a Managed DirectX-test I've been playing around with in case you want a look. In the debug-folder you'll find the maxscript I used to export the program's content, and I think it's fairly well commented to be easily understood. The files MAX export is in an easily-parsable text-format. I'm not saying this is a good exporter, but it works Smiley Please have a forgiving mind looking over the C#-code that parses it, as it's not commented (however the parsing part should be pretty self-explanatory) and the rest of the code is... well. Messy. It's a test-app i'm playing around in...

Note that the script only exports selected objects in the scene, and they must be textured in some way or else the script might fail.

2  Java Game APIs & Engines / Java 3D / Re: simple texturing help on: 2004-12-13 22:21:53
Something along the lines of this:

QuadArray l_quad = new QuadArray(8, QuadArray.COORDINATES | GeometryArray.TEXTURE_COORDINATE_2 | QuadArray.COLOR_4);

//Set vertex world position
            l_quad.setCoordinate(0, new Point3f(0.0f, 0.0f, -3.0f));
            l_quad.setCoordinate(1, new Point3f(2.0f, 0.0f, -3.0f));
            l_quad.setCoordinate(2, new Point3f(2.0f, 3.0f, -3.0f));
            l_quad.setCoordinate(3, new Point3f(0.0f, 3.0f, -3.0f));
//Set vertex texture coordinates
            l_quad.setTextureCoordinate(0, 0, new TexCoord2f(0, 0));
            l_quad.setTextureCoordinate(0, 1, new TexCoord2f(1, 0));
            l_quad.setTextureCoordinate(0, 2, new TexCoord2f(1, 1));
            l_quad.setTextureCoordinate(0, 3, new TexCoord2f(0, 1));

//Set vertex color
l_quad.setColor(0, new Color4f(1, 1, 1, 1));
            l_quad.setColor(1, new Color4f(1, 0, 0, 1));
            l_quad.setColor(2, new Color4f(1, 1, 1, 1));
            l_quad.setColor(3, new Color4f(1, 1, 1, 1));
//Set up appearance with texture
            Appearance l_quadappearance = new Appearance();
            Texture l_quadtex = new TextureLoader("texture.jpg", this).getTexture();
            TextureAttributes l_texatt = new TextureAttributes();

//Add quad to new (or existing) branchgroup
BranchGroup l_group = new BranchGroup();
l_group.addChild(new Shape3D(l_quad, l_quadappearance));

This code should work, if it doesn't let me know. I copy/pasted it from a prog I had here, so I might have missed something in the rush.

Hope this helps!

3  Java Game APIs & Engines / Java 3D / Re: Using KeyListener to modify a transform on: 2004-12-04 09:33:20
You need to apply the transformations to a transformgroup, and a transformgroup may contain geometry or it may have other transformgroups as children. If you want to apply a transform after a transformgroup is added to the branchgraph, you need to set write-capability for the transformgroup, something like this (before adding to branchgroup):



Then, assuming your 'tg' is a class variable, you can set transforms from the keylistener functions, something like this:

if (event.getKeyCode() == KeyEvent.VK_RETURN)
angle+= 0.1;
Transform3D t3d = new Transform3D();

This should be sufficient to transform an object.

4  Java Game APIs & Engines / Java 3D / Re: ASE Loader on: 2004-11-29 15:29:46
You may use it however you like, there is no license Smiley

Think I mentioned it in some readme.txt or in the .java source files.

Nice to hear if someone finds it useful!

5  Java Game APIs & Engines / Java 3D / Re: Problem with loading 3D model! on: 2004-11-19 11:14:30
Maybe you should try to add a Java3D built-in primitive to your scene to make sure Java3D is not set up wrong. Also, in addition to the reasons Herkules mentioned, make sure the camera is not inside the model, in other words, either the model or the camera should be moved out of origo.

6  Java Game APIs & Engines / Java 3D / Re: ASE Loader on: 2004-11-19 11:09:56
Thanks for the input! You're right, I didn't think about that. Certainly something to consider.

7  Java Game APIs & Engines / Java 3D / Re: Create smooth curve with interpolation (Vecmat on: 2004-11-11 11:00:45
To draw a (cubic) bezier curve you'll need at least four control points, since each section will make use of four of them to approximate the curve. (EDIT: bad sentence)

In the following code, we're inside a loop calculating each curvepoint based on the controlpoints. First controlpoint is p_start, and the last is p_start+3. The variable l_t is the interpolator from the bezier curve section start and the bezier curve section end. The interpolator must be increased by the delta distance per curvesegment, which will be 1/sectionsegments.

The next bezier section (not to be confused with a curve-section here) will start at p_start+3 and end at p_start+6, four points. (EDIT: I wrote +7...)

To understand the bezier equation completely, you should make a google search on it.

m_curvepoints[l_curpoint].x = (int)(m_controlpoints[p_start+0].x*(1-l_t)*(1-l_t)*(1-l_t)
                                    + m_controlpoints[p_start+1].x*3.0*l_t*(1-l_t)*(1-l_t)
                                    + m_controlpoints[p_start+2].x*3.0*l_t*l_t*(1-l_t)
                                    + m_controlpoints[p_start+3].x*l_t*l_t*l_t);
                        m_curvepoints[l_curpoint].y = (int)(m_controlpoints[p_start+0].y*(1-l_t)*(1-l_t)*(1-l_t)
                                    + m_controlpoints[p_start+1].y*3.0*l_t*(1-l_t)*(1-l_t)
                                    + m_controlpoints[p_start+2].y*3.0*l_t*l_t*(1-l_t)
                                    + m_controlpoints[p_start+3].y*l_t*l_t*l_t);

If this doesn't help, or doesn't make any sense, I can upload the entire source so you can read through it yourself Smiley

Was this even close to what you were thinking of?

8  Java Game APIs & Engines / Java 3D / Java3D - Z-buffer clearing and frame drawing on: 2004-11-10 08:38:56
I was wondering if it is possible to clear the z-buffer in Java3D, to make use of i.e. skyboxes...

Also, I have not figured out how to completely redraw a scene in one frame, in other words: is it possible to redraw the scene manually, without Java3D having to do it in a separate thread? Java3D's way of redrawing the scenegraph often makes animations look choppy as it doesn't seem to update all vertex positions each frame. And I understand that, because how should it know that the frame is done? I saw someone mentioning the use of behaviours...?

9  Java Game APIs & Engines / Java 3D / Re: Modify texture in real time on: 2004-11-09 13:28:35
Can't you split the texture up into several smaller textures so you don't have to edit the entire landscape's texture each time?

Just a thought...

10  Java Game APIs & Engines / Java 3D / ASE Loader on: 2004-11-08 19:53:49
I have an ASE Loader that I would like to see if anyone found useful. It has a few built-in features such as basic collision detection and interpolated animation support. It would be nice if anyone would give me some feedback Smiley

If you're interested in checking the thing out, its located at The complete source code is available for download as well.

Thanks for your time,
11  Java Game APIs & Engines / Java 3D / Re: Terrain generation/following on: 2004-11-08 19:43:50
I have an ASE Loader that will allow you to follow terrain and check line collision against geometry. If you're interested in having a look, the address is:

The source code is also there, so it shouldn't be too hard to get the ideas and if necessary convert/modify it to fit your needs.

Pages: [1]
DesertCoockie (22 views)
2018-05-13 18:23:11

nelsongames (73 views)
2018-04-24 18:15:36

nelsongames (68 views)
2018-04-24 18:14:32

ivj94 (751 views)
2018-03-24 14:47:39

ivj94 (81 views)
2018-03-24 14:46:31

ivj94 (605 views)
2018-03-24 14:43:53

Solater (97 views)
2018-03-17 05:04:08

nelsongames (170 views)
2018-03-05 17:56:34

Gornova (388 views)
2018-03-02 22:15:33

buddyBro (1048 views)
2018-02-28 16:59:18
Java Gaming Resources
by philfrei
2017-12-05 19:38:37

Java Gaming Resources
by philfrei
2017-12-05 19:37:39

Java Gaming Resources
by philfrei
2017-12-05 19:36:10

Java Gaming Resources
by philfrei
2017-12-05 19:33:10

List of Learning Resources
by elect
2017-03-13 14:05:44

List of Learning Resources
by elect
2017-03-13 14:04:45

SF/X Libraries
by philfrei
2017-03-02 08:45:19

SF/X Libraries
by philfrei
2017-03-02 08:44:05 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‑
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!