Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (526)
Games in Android Showcase (127)
games submitted by our members
Games in WIP (593)
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 / JOGL Development / Re: joglutils: How to properly insert .3ds models? on: 2006-09-03 14:02:09
Model3DS was not really intended to be instantiated. If you do instantiate it, it will only load the 3DS model and not draw it. The intention was to keep the actual rendering separate from the loading. In the example, MyModel is used to demonstrate how to extend Model3DS for JOGL rendering. It is up to the programmer to add all the bells and whistles.

Loader3DS does the actual reading and loading of the 3DS file. Without it nothing works. But, you don't have to worry yourself with it because it is called/used in Model3DS which you should be extending.

Maybe I got something terribly wrong here, but with Model3DS and Loader3DS, the rendering is already separated from the loading. So why not insert the drawing into Model3DS?  Huh
Isnt that one of the most basic functions of such a class, to draw it onto the screen? Without that, all the remaining functionality is quite useless, isnt it?

Look at the MyModel class in the example and see how the JOGL code is rendering the model. You can easily add the color in there. It's only a simple example of how to use it. There is no way to anticipate what everyone wants/needs when they render thier model.

Thanks, I found it. But again, I wonder why it is not possible to anticipate what people want to do with their model. I would deem it quite mainstream to load all the info (materials, textures, attributes) into the model class and render it as it is described in the .3ds file (I have to admit, though, that I do not know which kind of information is stored in the .3ds file and which is missing). If someone really wants to change something about it, it seems quite natural to me to change the model (the .3ds file) instead of writing new import code. Still it would be possible to extend Model3DS and overwrite the methods if necessary.
I would really like to write everything by my own, but I am really quite a newbie to JOGL and 3D models. Otherwise I would not discuss but code instead.  Wink

BTW, is it in general possible to store animations in 3DS files? Otherwise I will have to look for other solutions anyway...

Thanks for the support, though!  Smiley
Eric
2  Java Game APIs & Engines / JOGL Development / joglutils: How to properly insert .3ds models? on: 2006-08-31 22:51:23
Hej again!

Concerning joglutils, I was now able to import one of my .3ds models into JOGL. But some issues are left:

1.  I had to use MyModel instead of Model3DS, which is only part of the test system, not the "official" class, right? But otherwise the render() method lacks, without which it is not possible to display the model? Also I could not find any use for Loader3DS...

2. All I actually see is the dark grey outline of my model, without any color or light or whatsoever. I guess this has to do with the Material, but the docs dont really say how to use it.

Apart from that: Good start, keep up the good work! Maybe some comments for the docs would be great, in the long term... ;-)

Eric
3  Java Game APIs & Engines / JOGL Development / missing the missing docs on: 2006-08-23 22:49:01
It was in the subversion repository, but it didn't occur to me to put it in the files&documents with the .jar build.  There should now be a .zip file with the documentation.  It isn't properly linking to the java.sun.com javadocs (as It didn't work by default in netbeans, and I haven't yet worked out how to make it link), but all the docs should be there...  Good luck!

I already searched through the repository and found only the same docs that I found now in the zip file. But it seems that all the docs for the 3DSLoader are located in a directory named "ThreeDS" which is missing.
Or am I missing something? Cheesy
4  Java Game APIs & Engines / JOGL Development / Javadocs already available? on: 2006-08-18 15:47:12
Hej hej!

I would like to test the 3DSLoader already and so downloaded the joglutils.jar. Unfortunately I could not find any documentation anywhere. Is it not uploaded or written yet, or was I just too dumb to find it?  Cheesy

Anyway, good luck with this project, I will be one of the first users!  Wink

Eric
5  Java Game APIs & Engines / JOGL Development / Re: JOGL (JSR-231) Model Loaders and Utility Demos on: 2006-08-16 12:54:11
Hej hej!

What is the good work doing, what is the current status?
Is there already a way to take advantage of one of the model loaders for JOGL?  Cheesy

A big fan waiting for something like this!
Eric
6  Java Game APIs & Engines / JOGL Development / Re: GLSL to come? on: 2006-08-15 16:48:41
I know somebody wrote a loader for JOGL.
So this means that one really has to write such a loader by himself?
OK then, how can I contact this person or access this loader?

Now if you want facility, choose Xith3D, Java3D or jME.
Thanks, but I would like to stick to pure JOGL. I already tried Java3D before which was way too complicated for my taste. Meaning I prefer no-scenegraph based extensions. Smiley
7  Java Game APIs & Engines / JOGL Development / Re: GLSL to come? on: 2006-08-15 15:33:10
Hint : I know no tool that can import .blend files. You have to export from blender to another format (.OBJ for static objects, e.g. or Cal3D/MD2/MD5 for animated objects).

I know about the exporting, I just don't know how to import them into JOGL... Sad
8  Java Game APIs & Engines / JOGL Development / Re: GLSL to come? on: 2006-08-14 17:34:08
1. IIRC, GLSL is already available though Jogl or LWJGL.
2. You don't need GLSL to load blender models.

1. What do you mean by "or"? I won't switch now to LWJGL!  Cool
2. So is there any description or example of how to do it? You won't believe how many hours I already spent searching for a way to import blender models into JOGL...  Sad
9  Java Game APIs & Engines / JOGL Development / GLSL to come? on: 2006-08-14 17:01:01
Hej community!

I just read that the newest OpenGL 2.1 includes a shading language called GLSL. Is that in any way subject to JOGL?

I have to admit that i don't fully understand what this would mean, but would this enable JOGL users to import Blender models into JOGL? I had the impression when I read about it. Anyway this is what I am looking for.  Cheesy

Cheers, Eric
10  Java Game APIs & Engines / JOGL Development / Re: Importer for Blender models? on: 2006-08-07 13:51:26
I would like to contribute, but unfortunately I am still a beginner in both JOGL and Blender.
But I would very appreciate such a tool, is there a chance in the near future for that?
Also if I saw correctly, there is no such suggestion yet in the joglutils project? Can you do this, eteq? I guess you are a little more into it than I am.  Wink
11  Java Game APIs & Engines / JOGL Development / Importer for Blender models? on: 2006-08-04 16:20:56
Hej JOGL community!

I know, a Blender importer was rejected to be part of the JOGL package as it should be somewhere external.
Still someone here probably knows where to turn to or what to do for importing Blender models?

Thanks a lot in advance,
Eric
12  Java Game APIs & Engines / JOGL Development / Re: How to keep a current GLContext? on: 2006-04-04 14:23:24
Thanks, great description in this other discussion!

Although I have the feeling that this is far more complicated than I suspected it to be, this solution seems to work quite well for me. Then again, I am far from being an expert...

Anyway, thanks a lot!

Eric
13  Java Game APIs & Engines / JOGL Development / still desperate on: 2006-04-03 12:51:19
Hi again!

Please, someone help me with this. I really couldn't find anything helpful anywhere, so please just some hint how to solve this!  Huh

Eric
14  Java Game APIs & Engines / JOGL Development / Re: How to keep a current GLContext? on: 2006-03-28 09:13:13
Hej there again!

I hope this thread did not get forgotten over the weekend?

Please just some short explanation or remarks!

Thanks, Eric
15  Java Game APIs & Engines / JOGL Development / Sorry, code marking does not work here on: 2006-03-24 15:46:21
I just saw that the code somehow cannot be marked red. Anyway, the three lines that I meant are surrounded by tags.

Too bad that this doesnt work, would be extremely helpful to mark code lines...

Eric
16  Java Game APIs & Engines / JOGL Development / How to keep a current GLContext? on: 2006-03-24 15:43:16
Greetings everyone!

I am working on an application which shall be able to use different GUIs.

My JOGLGUI.java is structured like this (I removed everything that cant relate to my problem):

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  
public class JOGLGUI implements GLEventListener {
   
   private Frame frame;
   private GL gl;
   private GLU glu;
   private float camPosX = 0, camPosY = 0, camPosZ = -5, camAngle = 29;
   private GraphicsDevice graphicsDevice;
   private Texture texture;
   [color=Red]private GLContext glcontext;[/color]

   public JOGLGUI() {
      frame = new Frame("JOGLGUI");
      graphicsDevice = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice();
      if (graphicsDevice.isFullScreenSupported()) {
         frame.setUndecorated(true);
         graphicsDevice.setFullScreenWindow(frame);
      } else {
         frame.setSize(800, 600);
      }
      glu = new GLU();
      GLCanvas canvas = new GLCanvas();
      [color=Red]glcontext = canvas.getContext();[/color]
      canvas.addGLEventListener(this);
      frame.add(canvas);
      final Animator animator = new Animator(canvas);
      frame.setVisible(true);
      animator.start();
   }
   
   public void drawItems() {
      [color=Red]glcontext.makeCurrent();[/color]
      texture.bind();

      gl.glNewList(1, GL.GL_COMPILE);
         gl.glBegin(GL.GL_POLYGON);
            gl.glTexCoord2i(0, 0); gl.glVertex2i(0, 0);
            gl.glTexCoord2i(1, 0); gl.glVertex2i(1, 0);
            gl.glTexCoord2i(1, 1); gl.glVertex2i(1, 1);
            gl.glTexCoord2i(0, 1); gl.glVertex2i(0, 1);
         gl.glEnd();
      gl.glEndList();
   }

   public void init(GLAutoDrawable drawable) {
      gl = drawable.getGL();
      gl.glEnable(GL.GL_DEPTH_TEST);
      gl.glEnable(GL.GL_TEXTURE_2D);

      File texFile = new File("floor.bmp");
      try{
         texture = TextureIO.newTexture(texFile, true);
      } catch (IOException e) { System.out.println("Texture could not be loaded!"); }
     
   }   // init
   
   public void display(GLAutoDrawable drawable) {
      gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT);
     
      gl.glPushMatrix();
      glu.gluLookAt(camPosX, camPosY, camPosZ, camPosX, camPosY, 0, 0, -1, 0);
     
      gl.glPushMatrix();
      gl.glCallList(1);
      gl.glPopMatrix();
     
      gl.glPopMatrix();
     
      gl.glFlush();
   }
   
   public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {
      gl.glMatrixMode(GL.GL_PROJECTION);
      gl.glLoadIdentity();
      glu.gluPerspective(camAngle, (double)width/(double)height, 1.0, 20.0);
      gl.glMatrixMode(GL.GL_MODELVIEW);
      gl.glLoadIdentity();
   }
   
   public void displayChanged(GLAutoDrawable drawable, boolean modeChanged, boolean deviceChanged) {}

}


Now my problem is:
The method drawItems is called from the main class and is supposed to add or change items to be displayed. Therefore it needs to use loaded textures or generally even load new textures given. But when calling texture.bind() I get the Exception:

Exception in thread "main" javax.media.opengl.GLException: No OpenGL context current on this thread

How can I get around this? Also I dont really understand the GLContext concept, I guess.

I tried to save the GLContext as a class variable and make it current in drawItems() (red code), but then my program completely crashes and I have to abort it by CTRL-ALT-DEL. Also some other approaches failed, and I don't know how to solve this.

Any help greatly appreciated, and thanks in advance!  Cheesy

Eric
17  Java Game APIs & Engines / JOGL Development / Re: problem using GLContext on: 2006-03-16 20:11:38
I am really sorry if I get on anyone's nerves, but I still don't know where to find those demos. On java-gaming.org I can't find them. Anywhere else?

Eric
18  Java Game APIs & Engines / JOGL Development / code example where? on: 2006-03-16 18:26:24
Maybe I am a little dumb right now, but a code example is exactly what I am looking now for quite some time. Where do I find one that deals with the GLContext?

Cheers, Eric
19  Java Game APIs & Engines / JOGL Development / installing the JSR231 where? on: 2006-03-15 19:13:39
Hi again!

I am not sure where exactly to install the files from the JSR231 so they are found. It works well if I put the jogl.jar into the <j2re-directory>\lib\ext and the files from the jogl-natives-win32.jar into the <j2re-directory>\bin, and have the classpath set to the jogl.jar.

However, the user's guide says:
Quote
Dropping the JOGL jar and native library into the extension directory of the JRE is strongly discouraged.
and
Quote
If you are developing a new application which uses JOGL, download both jogl.jar and the appropriate native library jar file (for example, jogl-natives-win32.jar). It is recommended to place both of these jar files in the same directory. Modify your CLASSPATH environment variable to include the full path to jogl.jar; for example, ".;C:\Some\Other\Package\foo.jar;C:\Users\myhome\jogl\jogl.jar". (If you did not previously set the CLASSPATH environment variable, you may want to make sure that ".", the current directory, is on your new CLASSPATH.) Use the jar command which ships with the JDK to extract the native library jar; e.g., "jar xvf jogl-natives-win32.jar". Modify your PATH environment variable (Windows), LD_LIBRARY_PATH environment variable (Solaris and Linux), or DYLD_LIBRARY_PATH environment variable (Mac OS X) to contain the directory holding the new .dll, .so or .jnilib files. At this point your Java installation should be able to see the JOGL class files. Users of IDEs such as NetBeans and Eclipse should consult the IDE's documentation to see how to add jar files and native libraries to their current project.

So I tried it this way and put all files into the same directory outside the J2RE-directory and set the CLASSPATH and PATH variables accordingly. Still my Eclipse tells me that it doesn't find the javax.media.opengl package anymore, so what is there more to know? Anything inside Eclipse? Any directory substructure inside the JOGL directory where the files are?

Help is as always greatly appreciated!  Smiley

Eric
20  Java Game APIs & Engines / JOGL Development / problem using GLContext on: 2006-03-15 12:47:21
Hello everyone!

I recently decided to make a little 3D Java game using jogl. So I downloaded the current release JSR231 (not the nightly built) and tried to get started with the help of some tutorials and demos.

I soon noticed that all code examples use a line like

1  
GLCanvas canvas = GLDrawableFactory.getFactory().CreateGLCanvas (glcaps);


The method CreateGLCanvas does not exist anymore in the current release but is replaced by createExternalGLContext. So I read through everything I could find about it (mainly the API) and tried to make it work like this, even without examples. I have to admit I am a rookie in 3D programming...

So I created some starting code like:

1  
2  
3  
final GLCapabilities glcaps = new GLCapabilities();
GLCanvas glcanvas = new GLCanvas(glcaps);
final GLContext glcontext = GLDrawableFactory.getFactory().createExternalGLContext();


But when I try to make it run using eclipse I get an error message like:

   Exception in thread "main" javax.media.opengl.GLException: Error: attempted to make an external GLContext without a drawable/context current

I guess I have to make the glcanvas the current one first, but I really have no idea how, could not find anything in the jogl API.

Any help would be greatly appreciated, also any hint about whether I should really use this current release or maybe an earlier one?

Thanks a lot in advance,
Eric
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.

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

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

toopeicgaming1999 (15 views)
2014-11-26 15:20:08

SHC (29 views)
2014-11-25 12:00:59

SHC (27 views)
2014-11-25 11:53:45

Norakomi (32 views)
2014-11-25 11:26:43

Gibbo3771 (27 views)
2014-11-24 19:59:16

trollwarrior1 (40 views)
2014-11-22 12:13:56

xFryIx (78 views)
2014-11-13 12:34:49

digdugdiggy (56 views)
2014-11-12 21:11:50
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

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06
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!