Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (487)
Games in Android Showcase (110)
games submitted by our members
Games in WIP (552)
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 / Re: Help Needed With a Collision Detection on: 2012-06-12 21:25:13
I recommend JBullet it is a Java port of the Bullet physics engine, which is really good. You should try it.
2  Game Development / Newbie & Debugging Questions / Terrain texture glitching? on: 2012-06-08 19:10:29
I am using Ardor3D for a game. I made a simple array terrain data provider (creates terrain out of a float array). Then, I used an awtexturesource (provides texture for the terrain) and added a white rectangle that fills the whole terrain. At certain angles, though, it looks like :


What are the random black areas??? What am I doing wrong?

Code: (ExampleBase is a simple base for games that calls initExample() then repeatedly calls updateExample() in a loop)


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  
public class Level extends ExampleBase {

   Node _level=new Node("Level Root");
   private final float farPlane = 8000.0f;
   private Terrain terrain;
   
   final int SIZE = 2048;
   PointLight pl=new PointLight();
   
   
   private double counter = 0;
    private int frames = 0;

   public void updateExample(ReadOnlyTimer t){
      counter += t.getTimePerFrame();
        frames++;
        if (counter > 1) {
            final double fps = frames / counter;
            counter = 0;
            frames = 0;
            System.out.printf("%7.1f FPS\n", fps);
        }
      pl.setLocation(_canvas.getCanvasRenderer().getCamera().getLocation());
   }
   
   
   @Override
   protected void initExample() {
      _canvas.setTitle("Terrain Example");
        _canvas.getCanvasRenderer().getCamera().setLocation(new Vector3(0, 10, 0));
        _canvas.getCanvasRenderer().getCamera().lookAt(new Vector3(1, -300, 1), Vector3.UNIT_Y);
        _canvas.getCanvasRenderer().getCamera().setFrustumPerspective(
                70.0,
                (float) _canvas.getCanvasRenderer().getCamera().getWidth()
                        / _canvas.getCanvasRenderer().getCamera().getHeight(), 1.0f, farPlane);
        _canvas.getCanvasRenderer().getRenderer().setBackgroundColor(ColorRGBA.CYAN);
        _controlHandle.setMoveSpeed(300);
      setupDefaultStates();
     
      AwtTextureSource awt = new AwtTextureSource(8, TextureStoreFormat.RGBA8);
     
      try {
           
         final int SIZE = 2048;

            float[] heightMap=new float[SIZE*SIZE];
            for(int i=0;i<heightMap.length;i++)heightMap[i]=0f;
           
     

            final TerrainDataProvider terrainDataProvider = new ArrayTerrainDataProvider(heightMap, SIZE, new Vector3(1, 300, 1));

            TerrainBuilder b=new TerrainBuilder(terrainDataProvider, _canvas.getCanvasRenderer().getCamera());
            b.addTextureConnection(awt);
           
            terrain = b.setShowDebugPanels(true).build();

           
            terrain.getTextureClipmap().setShowDebug(false);
            terrain.reloadShader();
           
            _level.attachChild(terrain);
        } catch (final Exception ex1) {
            System.out.println("Problem setting up terrain...");
            ex1.printStackTrace();
        }
     

        AwtShapeElement rectangle = new AwtShapeElement(new Rectangle(2048, 2048));
        Transform t = new Transform();
        rectangle.setTransform(t);
        awt.getProvider().addElement(rectangle);
     
      _root.attachChild(_level);
     
   }
   //copied from ArrayTerrainExample
  private void setupDefaultStates() {
        _lightState.detachAll();
        final DirectionalLight dLight = new DirectionalLight();
        dLight.setEnabled(true);
        dLight.setAmbient(new ColorRGBA(0.4f, 0.4f, 0.5f, 1));
        dLight.setDiffuse(new ColorRGBA(0.6f, 0.6f, 0.5f, 1));
        dLight.setSpecular(new ColorRGBA(0.3f, 0.3f, 0.2f, 1));
        dLight.setDirection(new Vector3(-1, -1, -1).normalizeLocal());
       
        pl.setAmbient(new ColorRGBA(0.4f, 0.4f, 0.5f, 1));
        pl.setDiffuse(new ColorRGBA(0.6f, 0.6f, 0.5f, 1));
        pl.setSpecular(new ColorRGBA(0.3f, 0.3f, 0.2f, 1));
        pl.setAttenuate(false);
        _lightState.attach(pl);
        _lightState.attach(dLight);

        _lightState.setEnabled(true);

        final CullState cs = new CullState();
        cs.setEnabled(true);
        cs.setCullFace(CullState.Face.Back);
        _root.setRenderState(cs);

        final FogState fs = new FogState();
        fs.setStart(farPlane / 2.0f);
        fs.setEnd(farPlane);
        fs.setColor(new ColorRGBA(1.0f, 1.0f, 1.0f, 1.0f));
        fs.setDensityFunction(DensityFunction.Linear);
        _root.setRenderState(fs);
    }

   /**
    * @param args
    */

   public static void main(String[] args) {
      start(Level.class);

   }

}
3  Game Development / Newbie & Debugging Questions / How to create a JBullet shape from vertex array? on: 2012-06-07 21:52:54
I am new to JBullet, but I am using it for physics in my game. I am wondering how to create a rigidbody out of a vertex array, beacuse I have some terrain I generated with Ardor3D's terrain generation system, (I used an ArrayTerrainDataProvider) and I have the array of points for the vertices. How can I create a JBullet RigidBody from this vertex array?
4  Discussions / Miscellaneous Topics / Zove Games is looking for volunteer programmers... on: 2012-06-07 18:53:52
Sorry about the other post, which was written by my friend, and it kind of failed. Zove is looking for VOLUNTEER programmers (sorry, we can't pay you...  Undecided ) We have updated our site, http://zovegames.co.cc. If you are interested, please reply...
5  Game Development / Newbie & Debugging Questions / Ardor3d + JBullet: setting camera as rigidbody on: 2012-05-10 21:50:30
I am making a game in Ardor3D with JBullet, and I have created a CameraMotionState that extends MotionState, and created a RigidBody for the camera. The problem is, if I set the RigidBody mass to 0, the camera is free to move around by pressing keys, but it can go through objects. If I set the mass to anything else, then the camera falls and can't go through objects, but it is not free to move by pressing keys. How can I make it so the camera's RigidBody if free to move around, but still collides with objects?
6  Game Development / Networking & Multiplayer / Re: Java Proxy (not game related) on: 2011-11-04 19:33:10
A quick google search http://www.google.com/search?rlz=1C1TSND_enUS407US407&gcx=c&sourceid=chrome&ie=UTF-8&q=java+ssl yieilded this: you use
1  
java.net.ssl.*
, but you need a keystore. You can make one with JDK or Java SE with keytool.exe in the java folder\bin. Just open cmd and type
1  
keytool -genkey -alias "alias_here" -keyalg RSA -keystore "C:\path_to_keystore\keystore.jks" -keysize 2048
then use java.net.ssl.SSLServerSocket instead of java.net.ServerSocket (get full code here: http://stilius.net/java/java_ssl.php) and run it with
1  
java -Djavax.net.ssl.keyStore="C:\path_to_keystore\keystore.jks" -Djavax.net.ssl.keyStorePassword="password you chose in keytool.exe" server_class_here
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.

CopyableCougar4 (23 views)
2014-08-22 19:31:30

atombrot (34 views)
2014-08-19 09:29:53

Tekkerue (30 views)
2014-08-16 06:45:27

Tekkerue (28 views)
2014-08-16 06:22:17

Tekkerue (18 views)
2014-08-16 06:20:21

Tekkerue (27 views)
2014-08-16 06:12:11

Rayexar (65 views)
2014-08-11 02:49:23

BurntPizza (41 views)
2014-08-09 21:09:32

BurntPizza (31 views)
2014-08-08 02:01:56

Norakomi (41 views)
2014-08-06 19:49:38
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!