Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (497)
Games in Android Showcase (114)
games submitted by our members
Games in WIP (563)
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  Game Development / Newbie & Debugging Questions / Mouse sensitivity on: 2006-06-14 21:36:37
Hi,

I am playing with some nehe tutorial ports to jogl and a question came to mind : how can you change the mouse ***cursor*** sensitivity ?

Thanks

David
2  Java Game APIs & Engines / Xith3D Forums / Re: Xith3D performance on: 2003-12-06 14:15:37
Thanks for quickly answering. I put some code below. It is very long and quite unoptimized for the triangles generation. But even if the generation is badly coded, does it impact the performance (since the data are created just once) Huh

And as i said, the XithTerrainDemo is hanging my PC (and another too which is a Athlon550,GeForce256,512Mo RAM)

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
25  
26  
27  
28  
29  
30  
31  
32  
33  
34  
35  
36  
37  
38  
39  
40  
41  
42  
43  
44  
45  
46  
47  
48  
49  
50  
51  
52  
53  
54  
55  
56  
57  
58  
59  
60  
61  
62  
63  
64  
65  
66  
67  
68  
69  
70  
71  
72  
73  
74  
75  
76  
77  
78  
79  
80  
81  
82  
83  
84  
85  
86  
87  
88  
89  
90  
91  
92  
93  
94  
95  
96  
97  
98  
99  
100  
101  
102  
103  
104  
105  
106  
107  
108  
109  
110  
111  
112  
113  
114  
115  
116  
117  
118  
119  
120  
121  
122  
123  
124  
125  
126  
127  
128  
129  
130  
131  
132  
133  
134  
135  
136  
137  
138  
139  
140  
141  
142  
143  
144  
145  
146  
147  
148  
public class TerrainRenderer2
{
    Transform3D testRotateY = new Transform3D();
    TransformGroup testRotateYGroup = new TransformGroup();
    Material material = new Material();
    boolean play = true;
    boolean pause = false;
    TerrainData terrainMap = null;
    View view = new View();

    public static void main(String[] args)
    {
            <load image in map>
            final TerrainRenderer2 test = new TerrainRenderer2(map, panel);
            ...
            test.start();
    }

    public TerrainRenderer2(TerrainData terrainMap, Component ccc)
        throws Exception
    {
        this.terrainMap = terrainMap;

        // Prepare full-screen canvas adapted for current resolution
       Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();

        VirtualUniverse universe = new VirtualUniverse();

        view.setBackClipDistance(100f);
        view.setProjectionPolicy(View.PERSPECTIVE_PROJECTION);
        new Vector3f(0, 1, 0));
    view.getTransform().lookAt(
            new Vector3f(0, 3.5f, 3),
            new Vector3f(0, 0, 0),
       
        Locale locale = new Locale();
        universe.addLocale(locale);
        universe.addView(view);

        RenderPeer renderPeer = new RenderPeerImpl();
        CanvasPeer canvasPeer =
            renderPeer.makeCanvas(
                ccc,
                screenSize.width - 200,
                screenSize.height - 200,
                16,
                true);
        //canvasPeer.getWindow().setLocation(100, 100);
       Canvas3D canvas = new Canvas3D();
        canvas.set3DPeer(canvasPeer);
        view.addCanvas3D(canvas);

        BranchGroup scene = this.createSceneGraph();
        locale.addBranchGraph(scene);

        class KeyboardEventListener implements AWTEventListener{...}
        Toolkit.getDefaultToolkit().addAWTEventListener(
            new KeyboardEventListener(),
            AWTEvent.KEY_EVENT_MASK);
    }

    public void start()
    {
        <classical loop with view.renderOnce()>
    }

    public void stop()
    {
        play = false;
    }

    protected BranchGroup createSceneGraph() throws Exception
    {
        BranchGroup objRoot = new BranchGroup();

        AmbientLight light =
            new AmbientLight(true, new Color3f(0.25f, 0.25f, 0.25f));
        DirectionalLight dlight =
            new DirectionalLight(
                true,
                new Color3f(0.75f, 0.75f, 0.75f),
                new Vector3f(-1, -1, -1));
        objRoot.addChild(light);
        objRoot.addChild(dlight);

        // Add animation TransformGroup
       testRotateYGroup.setTransform(testRotateY);
        objRoot.addChild(testRotateYGroup);

        // Make extra transfrom we may want to play with (scale etc.)
       TransformGroup sceneRootTransform = new TransformGroup();
        Transform3D t = new Transform3D();
        t.setIdentity();
        t.setTranslation(new Vector3f(-2, 0, -2));
        sceneRootTransform.setTransform(t);
        testRotateYGroup.addChild(sceneRootTransform);

        material.setEmissiveColor(0.0f, 0f, 0f);
        material.setSpecularColor(0.5f, 0.5f, 0.5f);
        material.setAmbientColor(10.0f, 0.0f, 0.0f);
        material.setDiffuseColor(0.75f, 0.0f, 0.0f);
        material.setLightingEnable(true);

        int width = terrainMap.getSize().width;
        int height = terrainMap.getSize().height;
        int cellHeight = 0;

        //interpolatedHeightfield
       float[][] ihf = new float[width - 1][height - 1];

        for (int i = 0; i < ihf.length; i++)
        {
            for (int j = 0; j < ihf[0].length; j++)
            {
                <much much (too much ?) lines to generate the triangles >
                <looks like xith examples>
            }
        }

                int flags = GeometryArray.COORDINATES;
                flags |= GeometryArray.NORMALS;

                TriangleArray qa = new TriangleArray(coords.length, flags);
                qa.setCoordinates(0, coords);
                qa.setNormals(0, normals);

                Appearance a = new Appearance();
                a.setPolygonAttributes(
                    new PolygonAttributes(
                        PolygonAttributes.POLYGON_FILL,
                        PolygonAttributes.CULL_NONE,
                        0));
                a.setColoringAttributes(
                    new ColoringAttributes(
                        new Color3f(1, 0, 0),
                        ColoringAttributes.SHADE_GOURAUD));
                a.setMaterial(material);

                Shape3D shape = new Shape3D();
                shape.setAppearance(a);
                shape.setGeometry(qa);
                sceneRootTransform.addChild(shape);
            }
        }

        return objRoot;
    }
}
3  Java Game APIs & Engines / Xith3D Forums / Xith3D performance on: 2003-12-06 13:59:16
Hi !

First I'd like to say that I am a true beginner in the 3D world  Smiley I have coded a small terrain test. It's very basic ; it's loads a bitmap and creates for each pixel a square made of two triangles. Every cell shares its normal with the neighbours so the (gouraud) rendering looks smooth.
It looks fine but i got a 25fps for a 40*40 map, ie 40*40*2=3200 triangles... on a Athlon2000+, GeForce4200, 1Go RAM Cry I started from the cubetest and testutils classes.
So i'd like to know if i am really bad (probably) or if the performance of Xith are not so good Huh
Or maybe i miss some configuration point because the xith terrain demo is hanging the whole PC when launched...

Thanks
A pure beginner
4  Game Development / Newbie & Debugging Questions / Re: The book "Developing Games in Java" on: 2003-12-02 11:43:47
Hi !

I bought this book on Amazon a few days ago and I read almost the entire content, so I can now criticize it ;o) Well, briefly, it rocks !

At least for me. I have already read 10 thousands of articles and tutorials on the web and a couple of books too. However I am a true beginner in the game world althought I have ideas about a majority of the vast amount of subjects involved in a game creation. Furthermore I know really well Java for professional purpose.

This book really is not for Java beginner and that alone is a really good point. Because it's rare. The chapters are well organized and there is good explanations along the code. I learnt how a basic (full java) 2D and 3D game engine can be laid out and my ideas are much more clearer.
So if you are like me a beginner in game dev but not in java, i just recommend it.

PS: it does not cover the OGL not J3D stuff but JOGL is too young and it's not it's goal.
5  Discussions / General Discussions / Anyone interested in a "full" game engin on: 2003-08-08 10:27:13
Hi,

I have been around for a few weeks now, and i was very interested by the MODA project which is a "full" game engine ; at least in its overview, since this project seems to be dead before having ever started ?!? (has someone some info ?)

So, i'm wondering if anyone is interested in developping a "full" game engine (i mean not just a graphical one) ? I'd be proud of starting this one, but although i am a skilled programmer, my experience in game dev is not very wide  Embarrassed...

Then ...

DD
Pages: [1]
 

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

The first screenshot will be displayed as a thumbnail.

BurntPizza (15 views)
2014-09-19 03:14:18

Dwinin (33 views)
2014-09-12 09:08:26

Norakomi (58 views)
2014-09-10 13:57:51

TehJavaDev (81 views)
2014-09-10 06:39:09

Tekkerue (40 views)
2014-09-09 02:24:56

mitcheeb (63 views)
2014-09-08 06:06:29

BurntPizza (46 views)
2014-09-07 01:13:42

Longarmx (33 views)
2014-09-07 01:12:14

Longarmx (38 views)
2014-09-07 01:11:22

Longarmx (36 views)
2014-09-07 01:10:19
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

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06

List of Learning Resources
by SilverTiger
2014-07-31 11:54:12

HotSpot Options
by dleskov
2014-07-08 01:59:08
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!