Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (499)
Games in Android Showcase (118)
games submitted by our members
Games in WIP (568)
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] 2
1  Java Game APIs & Engines / JOGL Development / Re: JavaWebStart error on Windows on: 2006-07-28 11:13:06
Scan your hard disk for all copies of jogl.jar and jogl*.dll and delete them. I think it must be the case that you've dropped a jogl.jar into jre/lib/ext of one of your Java installations on the machine, which doesn't play well with Java Web Start.


Thanks, you're right, i've found the libs on the jre folders and i deleted them. But it's strange because the window appears green instead of black on this computer...

All i'm doing is to set up the the basic code to perform opengl on a frame.

Quote
import java.awt.*;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;

import javax.media.opengl.*;

import com.sun.opengl.util.*;

public class Game implements GLEventListener {

   public static void main(String[] args) {
      Frame frame = new Frame ("Game");
      GLCanvas canvas = new GLCanvas();
      
      canvas.addGLEventListener(new Game());
      frame.add(canvas);
      
      final Animator animator = new Animator();
      
      frame.addWindowListener(new WindowAdapter() {
         public void windowClosing(WindowEvent e) {
            new Thread(new Runnable() {
               public void run() {
                  animator.stop();
                  System.exit(0);
               }
            }).start();
         }
      });
      
      frame.setSize(300, 300);
      frame.setVisible(true);
      
      animator.start();
   }
   
   public void init(GLAutoDrawable drawable) {
      
   }
   
   public void display(GLAutoDrawable drawable) {

   }

   public void displayChanged(GLAutoDrawable drawable, boolean modeChanged, boolean deviceChanged) {
      
   }

   public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {
      
   }

}
2  Java Game APIs & Engines / JOGL Development / JavaWebStart error on Windows on: 2006-07-27 17:01:09
Hello,

I'm writing tutorials on learning OpenGL using JOGL and Java and for each article, i link a demo which could be launched with JWS.

Here is my JNLP descriptor :
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
<?xml version="1.0" encoding="utf-8"?>
<jnlp spec="1.0+" codebase="http://info-rital.developpez.com/tutoriel/java/opengl/opengl1/fichiers/" href="opengl1.jnlp">
  <information>
    <title>Apprendre l'OpenGL avec Java : Article 1</title>
    <vendor>InfoRital</vendor>
    <homepage href="http://info-rital.developpez.com/"/>
    <description>Création d'
une fenêtre pour faire de l'OpenGL</description>
    <description kind="short">Création d'
une fenêtre pour faire de l'OpenGL</description>
    <offline-allowed/>
  </information>
  <resources>
    <j2se version="1.4+"/>
    <jar href="opengl1.jar" main="true"/>
    <extension name="jogl" href="http://download.java.net/media/jogl/builds/archive/jsr-231-webstart-current/jogl.jnlp" />
    <property name="sun.java2d.noddraw" value="true"/>
  </resources>    
  <application-desc main-class="developpez.opengl.Article1" />
</jnlp>

As you can see, i use the resource : <extension name="jogl" href="http://download.java.net/media/jogl/builds/archive/jsr-231-webstart-current/jogl.jnlp" /> for loading JOGL libs.

It works fine on Linux but on Windows, it doesn't want to launch.
The error is caused by "no jogl in library path".

If you want to try, the link is : http://info-rital.developpez.com/tutoriel/java/opengl/opengl1/fichiers/opengl1.jnlp
It's really strange because on linux, i don't have the libs installed (neither on Windows) and it loads the jsr-231 without problem.

Thanks.
3  Discussions / General Discussions / Re: Game Development APIs in Java - important, please read on: 2006-02-20 22:20:35
Maybe you can add :
Jirr : binding for irlicht
Ogre4j : binding for Ogre3D

And a reader of one of my article on Developpez.net emailed and made me know VTK (a powerful scenograph) and its binding for Java.
4  Java Game APIs & Engines / OpenGL Development / Re: VBOs don't work on ATi card on: 2005-12-23 21:14:53
A friend had tested it and he got the same issue : a black screen, on a sony vaio laptop, with a Geforce 6400 TC.

I've put here the sources if someone want to take a look on them.
5  Java Game APIs & Engines / OpenGL Development / Re: VBOs don't work on ATi card on: 2005-12-23 16:35:47
Are you sure the 700 series supports the VBO extensions? I know my ATI Mobility 7000 IGP doesn't.

Kev

I'm not sure that ATI 7000 IGP and X700 are the same series, are they ?
But i suppose my card supports VBOs because the demo "VBOTest" works on my computer (except if this demo uses vertex arrays, or somethink like that, if VBO extension isn't supported...).

And i got only once a crash, generally, i got juste a black screen during 5sec. I suppose that everything works, except that the cube isn't drawn.
6  Java Game APIs & Engines / OpenGL Development / Re: VBOs don't work on ATi card on: 2005-12-23 11:52:30
Thank for all your replies and sorry for the esc touch, i've completely forgot it  Embarrassed (but on my computer, the scene lasts about 4 sec).
So it must be a driver problem no ?

But there is no update from my laptop constructor (Asus), and with the ATI test program for the installation of the generic driver, it said that i can't install the driver on my laptop... i don't know if i can nevertheless install it.
7  Java Game APIs & Engines / OpenGL Development / VBOs don't work on ATi card on: 2005-12-22 22:00:59
Hi,
I've coded a small code where i use VBO with LWJGL. On my PC, which has a Gf 6800 GT card, my code just works fine.
But on my laptop with a ATi X700, i get nothing or it even crashes my computer.

I've made a small jnlp file for testing with JWS.

Could you test it please ? http://www.jigames.info/jws/vbo.jnlp

Warning : if you have an ATi card, it may crash your windows, but i'm not sure.

Thanks.
8  Java Game APIs & Engines / OpenGL Development / Re: tutorial on LWJGL, where??? on: 2005-11-12 23:28:57
If you understand french, you can go on JIGames Community : http://www.jigames.info/ .

There are tutorials on LWJGL, JOGL and Java gaming.
9  Java Game APIs & Engines / JOGL Development / JSR-231and GLCanvas on: 2005-11-12 14:20:10
Hi,

I've downloaded the last build (11/11) of JOGL. But i've a problem with GLCanvas. So i downloaded the demo's source of Gears, and the problem was the same.
Here's the line :
1  
GLCanvas canvas = GLDrawableFactory.getFactory().createExternalGLDrawable();

I've replaced it by a simple GLCanvas canvas = new GLCanvas(); and that's work !

Is it a nightly change in the JSR-231 ?

Thanks.
10  Java Game APIs & Engines / OpenGL Development / Re: Bug : checking extension crashes my app on: 2005-10-25 21:07:28
Yes, and that was what i did first. But the error was an "design error", a bad implementation of my code.
And just after i posted this mess, i understand where was the error.

But thanks for your answers and sorry for my mistakes.
11  Java Game APIs & Engines / OpenGL Development / Re: Bug : checking extension crashes my app on: 2005-10-25 20:01:23
Sorry it was an error in my original code (the one i've posted before was a simple test).
Now the problem is solved, i don't get the error and the crash.
12  Java Game APIs & Engines / OpenGL Development / Bug : checking extension crashes my app on: 2005-10-25 19:51:11
Hi,
I'm trying to play with VBOs but before i must check if they are available. So i do :
1  
if(GLContext.getCapabilities().GL_ARB_vertex_buffer_object)


But that crashes my JVM.

That's my code :
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
import org.lwjgl.opengl.GLContext;

public class CTest {


   public static void main(String[] args) {
      if(GLContext.getCapabilities().GL_ARB_vertex_buffer_object) {
         System.out.println("Hello !");
      }

   }

}


And  that's the ouput from the log :
Quote
#
# An unexpected error has been detected by HotSpot Virtual Machine:
#
#  SIGSEGV (0xb) at pc=0xb2727d1c, pid=14741, tid=3085366976
#
# Java VM: Java HotSpot(TM) Client VM (1.5.0_05-b05 mixed mode)
# Problematic frame:
# j  CTest.main([Ljava/lang/String;)V+3
#

---------------  T H R E A D  ---------------

Current thread (0x0805c058):  JavaThread "main" [_thread_in_Java, id=14741]

siginfo:si_signo=11, si_errno=0, si_code=1, si_addr=0x00001760

Registers:
EAX=0x00000000, EBX=0x00001760, ECX=0x00000000, EDX=0x00000008
ESP=0xbfcdbf30, EBP=0xbfcdbf4c, ESI=0xae81715b, EDI=0xbfcdbf54
EIP=0xb2727d1c, CR2=0x00001760, EFLAGS=0x00010246

Top of Stack: (sp=0xbfcdbf30)
0xbfcdbf30:   bfcdbf30 ae81715b bfcdbf54 ae817348
0xbfcdbf40:   00000000 ae817180 bfcdbf54 bfcdbf68
0xbfcdbf50:   b2717157 aab8edf8 00000001 b7a567a8
0xbfcdbf60:   0805c058 bfcdc1a4 bfcdc018 b7879b6c
0xbfcdbf70:   bfcdbfd0 bfcdc1a4 0000000a ae817180
0xbfcdbf80:   b271fb70 bfcdc0c4 00000001 0805c058
0xbfcdbf90:   00000001 bfcdbfb0 bfcdbfd0 00000000
0xbfcdbfa0:   bfcdc1a4 00000000 0000000a b271fb70

Instructions: (pc=0xb2727d1c)
0xb2727d0c:   44 91 1c 59 c1 e8 1c 83 e0 0f 0f 85 0a 00 00 00
0xb2727d1c:   0f be 04 19 50 e9 a4 00 00 00 83 f8 03 0f 85 09

Stack: [0xbfae1000,0xbfce1000),  sp=0xbfcdbf30,  free space=2027k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
j  CTest.main([Ljava/lang/String;)V+3
v  ~StubRoutines::call_stub
V  [libjvm.so+0x16cb6c]
V  [libjvm.so+0x25f688]
V  [libjvm.so+0x16c99f]
V  [libjvm.so+0x18fd12]
V  [libjvm.so+0x1844a7]
C  [java+0x17fe]
C  [libc.so.6+0x14ea2]  __libc_start_main+0xd2
See the full log in the joined file.

I've tried with Java 1.5 and Java 1.6. I'm under Ubuntu Breezy. My graphic card is a NVidia 6800GT. I have the last driver from nvidia installed.
LWJGL version is 0.98-1.

I can replace the extention by any other one, it gives me the same.

Is it a bug ?
13  Game Development / Performance Tuning / Re: double[] or float[] vs JVector3 class on: 2005-10-24 20:54:57
So theoricaly what's the best way to represent 3D space in term of performance and memory usage ?
Many small objects or float/double array ?
14  Java Game APIs & Engines / JOGL Development / Re: Display Change and Fullscreen Exclusive Mode on: 2005-10-10 20:04:34
The way the AWT APIs work you have to be in full-screen exclusive mode in order to even check to see whether display changes are supported.
Shame on me  Embarrassed Thank for your helpful information, I've updated my code in my first post.
Now, isDisplayChangeSupported() returns "true" on my Linux computer with JDK 1.6 . Smiley
But no changes with JDK 1.5, but it's normal, FullScreen Exclusive Mode doesn't work with JDK 1.5 on Linux (or at least with most of computers under Linux).

So there is no more problems with JOGL and Linux (at least with window part) ?

Thank for JSR-231, i will take a look on it.
15  Java Game APIs & Engines / JOGL Development / Display Change and Fullscreen Exclusive Mode on: 2005-10-10 18:39:39
Hi,
I'm playing a bit with Jogl because i like very much both APIs (LWJGL and JOGL) and i can't choose only one to use in my programs Smiley.
So i know that LWJGL has its own native window system, so we can get a true fullscreen even on Linux.
But JOGL depends on AWT for the window part, and i've heard that Linux has no true fullscreen with AWT.

Okay, but what's a true fullscreen ? With AWT, set a true fullscreen must be done with the setFullScreenWindow() method from de the GraphicsDevice class ?

But isFullScreenSupported() returns allways false on my system (Ubuntu Hoary and Breezy and JDK 1.5). But with the JDK 1.6, it returns "true", and yes, i get a fullscreen exclusive mode (for example, i can't switch between different desktops).

So with JDK 1.6, we have a true fullscreen (and certainly better performances) on Linux and AWT is no more a problem for JOGL, or am i wrong ?

But there is the problem of display change. isDisplayChangeSupported() allways returns "false" on my computer (Ubuntu, nvidia drivers, JDK 1.5_05 and JDK 1.6-b55).
Is there somebody who have display change supported on Linux ?
Will it be corrected in the next build of JDK 1.6 ?

Thanks for your answers, and sorry for my english, i'm a french speaker Smiley.

If you want to try a little test that i've make and share the ouput of the class :
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  
import java.awt.Frame;
import java.awt.GraphicsDevice;
import java.awt.GraphicsEnvironment;
import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;



public class FSMTest {

static Frame frame;

   public static void main(String[] args) {
      frame = new Frame("Test");

      pressKey();
      GraphicsDevice graphicsDevice = GraphicsEnvironment
            .getLocalGraphicsEnvironment().getDefaultScreenDevice();



      if (graphicsDevice.isFullScreenSupported()) {
         System.out.println("FS Exclusive Mode supported");
      } else {
         System.out.println("FS Exclusive Mode non supported");
      }
      frame.setUndecorated(true);
      graphicsDevice.setFullScreenWindow(frame);
     
      if (graphicsDevice.isDisplayChangeSupported()) {
         System.out.println("Display change supported");
      } else {
         System.out.println("Display change non supported");
      }
     
      System.out.println("JVM version : "
            + System.getProperty("java.version"));
     
   }

   public static void pressKey() {
      final int _KEY = KeyEvent.VK_ESCAPE;
      frame.addKeyListener(new KeyListener() {

         public void keyPressed(KeyEvent e) {
            if (e.getKeyChar() == _KEY) {
               System.exit(0);
            }
         }

         public void keyTyped(KeyEvent e) {
         }

         public void keyReleased(KeyEvent e) {
         }

      });
   }
}


Press escape to exit the fullscreen application.
16  Discussions / Miscellaneous Topics / Re: French Java Games Community on: 2005-09-18 10:15:58
Thank you for your answers. Any help is accepted with great pleasure. Wink
Quote
i'm not sure there are enough french benevolents out there in our domain
Yes, you're right, but i've had a discussion on it, last day with Chman, and i think with this kind of action (JIG Community), the french indie (or not) java games developers can seriously grow.
17  Discussions / Miscellaneous Topics / French Java Games Community on: 2005-09-10 14:04:57
Hi,
I don't know if it's the right place to post that but i haven't found a better one on this forum.

Java In Games, or JIGames, or JIG, is a community for Java French Games Developers.
JIG has been founded by two members of this forum (I and Bluesky, the author of the Gamma Project).
JIG has three aims :
1-Promote Java in Games developement (indie games for the moment).
2-The french-speaking web has a very few resources in Games Developement and almost no resources in Java Games Developement.
So JIG wants to be the reference web site in the french web.
3-Develop some community projects around Java Games Developement (like Gamma, the 3D engine based on top of Xith3D).
 The Gamma game engine (in version 0.01) is already downloadable on the site.
We (will) provide many articles on Java in multimedia applications and games, like 2D/3D (OpenGl) APIs, Sound APIs, Inputs APIs, Network, Scenegraphs, performances boost...

We provide a forum on which you can ask your question, help each other, discuss about Java, OpenGL...(in french of course).

We haven't buy yet the domain name, but you can acces to the site by the following URLs :
http://jigames.no-ip.info
http://213.251.134.220/~linuxproje/portail/

We'll buy the domain name when the community is going to become active.

PS : The site doesn't work very well on Internet Explorer because it has been made in Full-CSS and IE have unfortunately a poor support of CSS. All CSS bugs may be fixed soon but for a best display, try a better browser like Firefox, or send us some fixes and hacks for IE (I'm under Linux and i've no direct acces to a Windows).

Bye and see you on JIG !

JIG Staff

-----French Version-----

Java In Games  alias JIG, ou encore JIGames, le premier site francophone sur le développement de jeux en Java !

Ce portail a pour but de vous proposer des articles, cours et autres ressources sur le développement d'applications 3D et jeux en Java.
Vous y trouverez entre autres des cours sur l'utilisation des APIs Java pour la réalisation de jeux, des astuces pour obtenir le meilleur de Java et pour avoir toujours de meilleurs performances, des articles sur l'utilisation d'EDI comme Eclipse et NetBeans, pour le développement de vos jeux et projets, des conseils pour la réalisation de vos projets, des tutoriaux sur la 2D/3D, le son et l'utilisation des périphériques dans les jeux...

Nous vous proposons aussi un Forum sur lequel vous pourrez pauser vos questions sur tous les sujets précédemment cités ou encore de discuter de l'actualité de Java, d'OpenGL...

De plus de tous ces articles, nous développons et nous développerons d'autres projets parallèles, tels qu'un moteur de jeu, ou encore des outils pour la réalisation de vos jeux...
Tous ces projets seront libre et communautaires, c'est pourquoi nous comptons sur votre aide pour les mener à bien.

Nous n'avons pas encore acheté le nom de domaine. Nous le ferons une fois que la communauté aura un minimum de succès et sera suffisement active.
C'est pourquoi en attendant, nous nous contentons d'une redirection gratuite (http://jigames.no-ip.info).
Ou si vous préferez utiliser le lien direct vers le site :
http://213.251.134.220/~linuxproje/portail/
Si vous désirez effectuer un petit don en achetant le nom de domaine, ce serait avec grand plaisir.

Si vous souhaitez nous aider et rejoindre JIG, ou tout simplement nous proposer quelque chose, n'hésitez pas à nous contacter.

Attention : D'après nos tests, le site souffre de plusieurs bugs graphiques avec IE. Ceci est dû au fait que IE ne respecte pas les standards du W3C. Si vous voulez une affichage optimal, utilisez un naviguateur plus conforme comme Firefox. Toutefois, si vous désirez nous envoyer des correctifs pour les bugs d'affichage avec IE, nous les accepterons avec grand plaisir.

A Bientôt sur JIG !
L'Equipe de Java In Games

The server is online now Smiley.
18  Java Game APIs & Engines / OpenGL Development / Re: LWJGL features : OpenGL Shaders and 3Ds Loaders on: 2005-07-30 21:31:34
OK thanks, i think i will use OpenAL because it's for a commercial project and we use Jogl too, and there isn't any independant Java wrapper for FMod.
19  Java Game APIs & Engines / OpenGL Development / Re: LWJGL features : OpenGL Shaders and 3Ds Loaders on: 2005-07-30 19:53:38
Which parts don't we have acces in Fmod3 with LWJGL because they're non free ?
20  Game Development / Newbie & Debugging Questions / Re: 3D File Format on: 2005-07-25 22:31:54
Yeah, that's exactly what i was thinking. Make a loader interface and then make sub-class for each different formats.
I hope that blender and 3d studio formats are working almost the same way, even if one is binary and the other is text based (i don't konw how works the blender format), and they're contaigning the same type of data (vertices list, surface description, mapped textured...).

Am I going wrong ?
21  Game Development / Newbie & Debugging Questions / Re: 3D File Format on: 2005-07-25 21:42:27
Or is it better to do two 3D loader format ?
One for 3DS Max Studio and its 3DS format.
And on for Blender and its Blend format.

Which do you thing is better ?
One format loader, which don't may be fully compatible with the both ?
Or two format loader for their native formats ?
22  Game Development / Newbie & Debugging Questions / 3D File Format on: 2005-07-25 21:22:32
Hi,
I was wondering what format must I use in my 3D programs ?

I was working on a 3DS Loader, but i've seen that blender dosen't support this format yet.

I've seen the OBJ format. Blender seems to support it. But what's about 3DS Max ?
Men who work with me use 3DS Max Studio and Blender.

I want to make only a 3D file loader.
3DS file format is baniry and OBJ is text based.

What about performances and features ? Does OBJ file format support all features and information of the bothes 3D Modeler programs ?

Which do you think is better ?

Thank.
23  Game Development / Newbie & Debugging Questions / Re: 3DS File and NIO on: 2005-07-23 17:28:27
Now i can't get the length of the chunks, the strings data, and the vertex list...
I've passed many hours today in it, but i found nothing that could help me on internet, and there is nothing in my books. But all are java and bytes problems.

First for the length, it's on 4 byte just after the chunk's id. But to get 4 bytes, it's getFloat(). But i've tried buffer.getFloat & 0xffffffff (8 f because of 4 bytes).
but that's wrong...so how can i get the 4 bytes after the id chunk and convert it to int ?

Then the string data, per exemple, for the object name.
I've found this code on internet :
1  
2  
3  
4  
5  
6  
7  
8  
9  
         case 0x4000: 
            i=0;
            do
            {
               fread (&l_char, 1, 1, l_file);
               p_object->name[i]=l_char;
               i++;
            }while(l_char != '\0' && i<20);
         break;


But it's in C.
I've tried to make this code :
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
int j = 0;
               char[] c = new char[20];
               StringBuffer sb = new StringBuffer();
               while(c[j] != '\0' && j<20){
                 
                  c[j] = buffer.getChar(i+j);
                  sb.append(c[j]);
                   i++;
                  }
               String st = sb.toString();
               System.out.println("Chaine = " + st);


"i" is the byte position in the buffer.
char[20] because of the 20 max caracteres and because i didn't know how to initialize my char array in an other war...

But that just doesn't work...

And finally for the vertex list, it's a vlue on 2 bytes just after the 0x4110 chunk. I found many 0x4110 chunks in my file, but it isn't the problem.
So i do :
1  
2  
int numbervertex = buffer.getShort(i);
               System.out.println(Integer.toString(numbervertex));


And it returns me 16656.Is it possible 16656 vertices for a 24824 bytes file ? And there is many 0x4110 in the file...

My basic function is on the previous post.


PS : where are the source of the vrmi-3ds loader on this site http://games.swizel-studios.com/tutorials.html ? I didn't found it in the library section and ine the jar and in the tutorial section there is only the applet source code.

Thank for your help.
24  Game Development / Newbie & Debugging Questions / Re: 3DS File and NIO on: 2005-07-23 09:50:23
That's my little function.
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  
   public static void readFile(File a_file) throws IOException {
      int i = 0;
      int length = (int) a_file.length();

      System.out.println("Loading " + a_file);

      System.out.println("Length of the file is " + length);

      FileInputStream fin = new FileInputStream(a_file);
      FileChannel fc = fin.getChannel();
      ByteBuffer buffer = ByteBuffer.allocate(length);

      while (i + 1 <= buffer.capacity()) {

         fc.read(buffer);
         byte[] l_bytes = buffer.array();

         if (i + 2 <= length) {
            if ((buffer.getShort(i) & 0xffff) == 0x4D4D) {
               System.out.println("Main Chunk found");
            }
         }

         String hex = Integer.toHexString(buffer.get(i) & 0xFF)
               .toUpperCase();
         if (hex.length() < 2) {
            hex = 0 + hex;
         }
         System.out.println(hex);

         i++;
      }
      System.out.println("File loaded");

   }


What do you think about my code ?
Is it better to map the file in memory rather than load it in streaming ?
25  Game Development / Newbie & Debugging Questions / Re: 3DS File and NIO on: 2005-07-23 09:19:26
Quote
If you look at the Beta v0.3 tutorial on my site, it shows you how to load and render a .3ds file, source code is provided as is a webstart demo.

http://games.swizel-studios.com/tutorials.html

Andy.

That was your version i quoted before. But i really don't find the source of the mri-v3ds loader...
26  Game Development / Newbie & Debugging Questions / Re: 3DS File and NIO on: 2005-07-22 23:09:34
Thanks for all your answers.

Quote
If you want to print the data in hex format, use Integer.toHexString somewhat like this:
Code:
byte[] bytes = ...

for (byte b : bytes) {
String hex = Integer.toHexString(b & 0xFF).toUpperCase();
while (hex.length() < 2) {
hex = "0" + hex;
}
System.out.println(hex);
}

Why the while (hex.lenght() < 2)) ? It makes the while infinite and always return 00.
If i remove this "while" it seems to work, i get on each line 2 caracteres (hex). But the while is very long, i had to kill it...

Quote
Hex numbers are numbers written in base 16 number system. We usually use the decimal system wich uses the base 10 number system. Hex has 16 symbols representing the 16 values. The 10 first is the same as the decimal system with 0-9. The last uses the characters A-F to sombolise the values 10-15. "C" written has hex means 12 written as decimal. When you've got more than one symbol you've got to multiply with 16 instead of 10. So "C4" means (12*16)+4=196. A hex symbol represents a 4 bit number. That is why they are usally written in pairs to represent bytes. "0xC4" represents a single byte, "0xC400" represents 2 bytes etc.  Look through your books again to read about hex, oct and binary representation of data. It might be in a appendix named "number formats".

So when the 3ds docs says "0x4000" it means you need to read 2 bytes, one with the value "0x40" and one "0x00.
Thanks for your little lesson, now it's clearly in my head. But my two books doesn't have any explication on number formats, binary, hexadecimal, decimal...and yet they were quite expensive...

Quote
The source code on this page might help you out:

http://www.multi.fi/~mbc/v3ds/Decode3dsApplet.html

If you're at the stage where binary files are an unknown concept you might want to start somewhere a little easier going. Writing a 3DS loader isn't the easiest place to start.

Kev
Thanks, but i already know this loader. And someone on this forum are the new maintainer of the loader. But wehre are the sources ? I can't found them. Not the sources of the applet, but the sources of the 3ds loader.

Quote
In your code you could use the l_bytes array directly, or wrap it in a DataInputStream. In any case you need to know what endian is used by the file format. Be also aware that java bates are signed wich you don't wan't. So to check for "0x4000" you could write:
Code:
if ( (l_bytes[0] & 0xff) == 0x00 && (l_bytes[1] & 0xff) == 0x40) {
  // marker at index 0 eqals 0x4000
}

What's the gain if i wrap it in a DataInputStream ?  And 3ds files use little-endian. Must i do something particular ?

And great thank tom ! Thanks to your help, i've succeeded to find the Main Chunk of my 3ds files  Smiley.

Thank to all of you, now i can start my 3ds loader  Smiley
27  Game Development / Newbie & Debugging Questions / Re: 3DS File and NIO on: 2005-07-22 20:17:46
If i load a binary file, convert it to int (is it possible ?) and then convert it to a string representation with the 16 base, i suppose that can work.
But the question is how to convert binary file to int ?
28  Game Development / Newbie & Debugging Questions / Re: 3DS File and NIO on: 2005-07-22 20:02:01
I've two Java books and only one deals with binary datas, it shows how to read a binary file with IO in one very short examples which is almost the same as the text file reading example.My last luck are internet examples and this forum.
So, a little help would be very helpful for me.

Thanks.
29  Game Development / Newbie & Debugging Questions / Re: 3DS File and NIO on: 2005-07-22 18:03:35
I succeed in loading and showing a text file with the above code :

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
   public static String readFile(File a_file) throws IOException {
      FileInputStream fin = new FileInputStream(a_file);
      FileChannel fc = fin.getChannel();
      ByteBuffer buffer = ByteBuffer.allocate(4 * 1024);
      StringBuffer l_stringBuffer = new StringBuffer();
      while (fc.read(buffer) != -1) {
         byte[] l_bytes = buffer.array();
         String s = new String(l_bytes, 0, buffer.position());
         l_stringBuffer.append(s);
         buffer.clear();
      }
      String retour = l_stringBuffer.toString();
      System.out.println(retour);
      return retour;
   }


But when i try to load an 3ds file, i get :
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  
MMo
==(>=
ÿ¯ì
APE ▒   kU      b6$  ▒  y       RCm0 ▒  ÿÿÿ     ÿÿÿ@ 9A NP R S  
?¢.d£APE.CELQS£
ÍÌÌ=ÿ¯ú ASPHALT


                                  ▒     ?=8     0 ▒     |xq     FB;@ A P R S    
¢2d£ASPHALT.JPGQS£

×£=ÿ¯ AMOEBA PATTERN ▒  C6C       ▒     t       U>T0 ▒  áà×     ÌÊŒ@ AP R S    
?¢2d£PAT0107.TGAQS£
ÍÌÌ=
?pH pÏp7Àh`å
            ? AðAamera01p7¿Àh`å
                               ?amera01p7wÀhÿÿ`å?@ACamera01p7¿wÀh`å
                                                                   ? AðAamera01p7üÿ?amera01p7Àh`å
                 ? AðAamera01p7¿Àh`å
                                    ?amera01p7wÀhÿÿ`å?@ACamera01p7¿wÀh`å
                                                                        ? AðAamera01p7üÿ?amera01
?P
`
?!▒¡  =¡  =¡  =*v?".zDÈB???"#(ÈB????#zDÈB#000
                                             MáÁ:M
Âu2BãC@5Box01A)AÀÂ/m®ÂïÃRÂĪÝB/m®ÂïÃRÂĪÝBx²BöÃRÂÀÂx²BöÃRÂÀÂ1m®Â©!ÏÂĪÝB1m®Â©!ÏÂĪÝBv²B­!ÏÂÀÂv²B­!ÏÂ@A=▒Ÿñ>|,A?ûc_>³?õB▒?(>     [?=▒Ÿés>|,A?=▒
                                                              »³?·»Ã>(>ê£"?pA\?? h@°▒wÂ?æ[_?,ú>
$l°6šØŸ>oA?¿,zŸæ[ß>׳]????A`A6?HDŽÿÿ¿ÿÿ?HDŽè@ºh?ÒAÂeA AÂ
                                                        0A$APE


P  @ÕCone01AÈA@▒Èûõ@hYd@W%CÜ3¢@ZÀW%CÌèÝ@ªRÁW%CLAÁW%CohšA{±ÁW%C÷&ìAD¢ÁW%C·­B{gÁW%Cµ&▒B(ÆÀW%C°Bô@W%C§öAñ¥
AW%CøqŽAö4AW%CØfaA{¯AW%C2m.Â[Bj{8µîó^Âûû¿: 6Ò^<ÂÏ$ÂöB#7#äÁÁžÂ³f7ãAü¥Â3»7p8fB±ÂWùm7.m®B`ö<Â=ß07°ÆBYýÁÓµ6fµBahòA&$4L_~B%ÖoB[¶PÊAl.BÉ=ž¶ò,_ÁÕÇ}B±C¶1m®Am®ÀW%C1m®AJm®ÀW¥6@AØ▒§W>É­a?N>É­a»>É­a?dÎÜ>É­a?Û<ý>É­a?5É?É­a?▒?É­a?p1?É­a?²(F?É­a?©/_?É­a?I}?É­a?¹ß=É­a?[->H©`=~>H©`=ë«>H©`=xÔ>H©`=Hü>H©`=@C?H©`=ó&?H©`=(S;?H©`=ÈáP?H©`=!3g?H©`~?H©`=.C§=H©`=ûÿÿ>É­a?ûÿÿ>H©`=pA\??4m®Ax²B???????A<▒`A6?HDŽÿÿ¿ÿÿ?HDŽ1m®A:m®ÀW¥BeA AÕ0▒
          ▒
           ▒
            ▒
             ▒
              ▒
               ▒
               ▒
                ▒






 ▒























                                                                               0AhASPHALT,


▒▒!#$%&'()*+,-./0AAMOEBA PATTERN"
PAÆ@ICamera01G:çÃØ:DÃ@C`KAAa▒BG GzD@CCamera02G4ç{_ChÂhÂêʪBhÁåÑÁÿÿGB GzD@ÄHSph01A·AÔžÎÃæÑBîbA/iÍÂþB¯Ú,?Pî¬▒wB€Ž?ý$ÃÂY»B
                                                                          ùk?ÆþÂÚBk­¿ÃË ÅB7^À~.ÃrBäy1À³M$ÃlBË%ÀMÃ2m®A¢ðZ¿ÍÒ±ÂéZAÂá)Â{ÂUqBÕ·%ÂøM£ÂóÃÒB¶|(Âi÷Âv(þB'0ÂâÃ(ÃMáBu99ÂÁo>ÃBgc=ÂK0Ã]ËA:ÂŒøïio@2ÂA*`A6Ž?1žD=žD!
                                                      ŽŽ¿1ÿÿ!
                                                             Ž°RÃäÑBRžWÁeA Av













                PA~°7
pH pÏp7Àh ±A?
             MáÁ:M
Âu2B AðAamera01p7¿Àh ±A?
                        MáÁ:M
Âu2Bamera01p7wÀh~|?
                   MáÁ:M
Âu2B@Aamera01p7¿wÀhÝh;?6GÂZ»âÁÜÑ%> AðAamera01p7wÀh~|?
                                                     MáÁ:M
Âu2B@Aamera01p7Àh ±A?
                     MáÁ:M
Âu2B AðAamera01p7¿Àh ±A?
                        MáÁ:M
Âu2Bamera01p7wÀh~|?
                   MáÁ:M
Âu2B@Aamera01p7¿wÀhÝh;?6GÂZ»âÁÜÑ%> AðAamera01p7wÀh~|?
                                                     MáÁ:M
Âu2B@Aamera0°   °
°²0°Box01p@ÿÿ° °&@è@ºh?ÒAÂ!°*@ÜÉ??"°&@???°
PwÖ>°³0°Cone01p@ÿÿ° °&@1m®A:m®ÀW¥B!°*@ÜÉ??"°&@???°
PwÖ>°I0°Camera01ÿÿ °&@`KA°0°Camera01pÿÿ °&@çÃØ:DÃ@C#°@|B$°@A°I0°Camera02ÿÿ °&@êʪBhÁåÑÁ°0°Camera02pÿÿ °&@ç{_ChÂhÂ#°@@B$°@°y0°HSph01p@ÿÿ° °pC°RÃäÑBRžWÁ¿PôÂòxB=¬¢ÁÍÌÌ>)\¿ž>?¶³²ÂäÑB|rÀÁ
°RÃäÑBRžWÁ!°V@º"É?FÚ?¹Ä<¹Ä<Vè>Ž¿²žDœPwÖ>Ž¿À±·Dœ"°J@???H¿??ZEC???)°°
PwÖ>°J0ÿÿ°$AMBIENT$ÿÿ%°&@¡  =¡  =¡  =


I wish you can see what i copy/put into the code marks, because it's only lots of special, very very special caracteres...and as i'm french, maybe we don't have the same charset...

Any idea of how i can get hexa datas (like 0x4D4D, 0x4000...) ?

Thanks.
30  Game Development / Newbie & Debugging Questions / Re: 3DS File and NIO on: 2005-07-22 15:03:09
I always read the documentation first but i don't  understand english very well, and they didn't explain the APIs uses and give  no examples..I must know the basics of NIO,whithout that it's a bit difficult to understand the javadoc.
And my search results didn't help anymore. I've found nothing on a simple file reading and showing it.  Reading with a channel, that's ok, but i can get the length of the buffer or text (remaigning() always gives me 0) for the while() to traverse the file. And i can't get the caracteres and the 3DS hexa bytes.

All the tutorials i've found always give me another way , but no one gives me a solutions to read and show a file as with standard IO.

That's why i ask for a little code which does that job...
Pages: [1] 2
 

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

The first screenshot will be displayed as a thumbnail.

Pippogeek (39 views)
2014-09-24 16:13:29

Pippogeek (30 views)
2014-09-24 16:12:22

Pippogeek (20 views)
2014-09-24 16:12:06

Grunnt (45 views)
2014-09-23 14:38:19

radar3301 (28 views)
2014-09-21 23:33:17

BurntPizza (64 views)
2014-09-21 02:42:18

BurntPizza (33 views)
2014-09-21 01:30:30

moogie (42 views)
2014-09-21 00:26:15

UprightPath (50 views)
2014-09-20 20:14:06

BurntPizza (54 views)
2014-09-19 03:14:18
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!