Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (495)
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] 2 3 ... 5
1  Java Game APIs & Engines / JOGL Development / Re: x-Coordinates go in negative direction!?! Everything is "mirrored"! on: 2006-02-06 09:03:35
You're right, OpenGL DOES use a right-handed coordinate system.
But in this case, positive x goes to the right, positive y up and positive
z out of the screen towards the user.

However, in my case pos. x goes left, pos. y up and pos. z into the
screen. This is weird, I'm really confused now.

The answer lies here:

glu.gluLookAt(eyeX, eyeY, eyeZ,
            centerX, centerY, centerZ,
            0, 1, 0);

As eyeZ is assigned a negative value of -10, your "camera" resides behind the X/Y-plane at Z=0 and thus everything seems mirrored. Moving the eyeZ to value of 10 should make the world seem normal again.
2  Java Game APIs & Engines / JOGL Development / Re: smooth shading problems on: 2006-02-03 15:15:17
should I use vertex normals instead of surface normals?

Yes, you should. Using a surface normal effectively means that all the vertices drawn for the surface will have the same normal - thus making the surface seem flat. You can generate vertex normal simply by averaging your current surface normals for each vertex if they are not provided to you by a modeling package.

So, basically a vertex normal VN for vertex V shared by surfaces A, B and C with normals AN, BN, CN (unit vectors) =

VN = normalize(AN + BN + CN)
3  Java Game APIs & Engines / JOGL Development / Re: Considering jogl, having 2 questions b4 on: 2005-10-03 12:33:17
Also take a look at JSmooth also which might be just what you need.

...and if that does not please you, take a look at Boostrap, which is a non-intrusive way of launching Java apps neatly on Windows platform:

http://www.g0dmode.com/javastuff/bootstrap-1.0.zip

4  Java Game APIs & Engines / JOGL Development / Re: Basic Textures In JOGl on: 2005-10-01 10:12:30
¿What may the problem be? ¿Why shouldn't it render correctly the ship image?

I think that the call gl.glColor3f(0f,0f,0f) causes them to appear black - this happens because of the texture-color modulation.

Simplest solution is to set the color to white (1, 1, 1).
You may also disable the texture modulation with the following code:

1  
gl.glTexEnvf(GL.GL_TEXTURE_ENV, GL.GL_TEXTURE_ENV_MODE, GL.GL_REPLACE); 
5  Java Game APIs & Engines / JOGL Development / Re: Basic Textures In JOGl on: 2005-09-26 19:42:49
To get you going with super-simple texture loading, you could try out this:

http://www.g0dmode.com/javastuff/jogl-textureio.zip

Use the TextureIO class to load textures from files. Then call initialize and bind methods for the created texture to use it.


6  Java Game APIs & Engines / JOGL Development / Re: JOGL + SWT on: 2005-09-10 19:35:13
technically - thats bridged SWT and not pure SWT.

That's true. The example embeds the JOGL GLCanvas to a SWT composite by using the bridging SWT_AWT.new_Frame(composite) call.
I've found this approach satisfactory in most cases. However, the bridging may cause some side effects regarding the event loops and threading models in the SWT and AWT libraries.

7  Java Game APIs & Engines / JOGL Development / Re: JOGL + SWT on: 2005-09-10 08:58:20
I have done that in the past. I uploaded an example with source code at:

http://www.g0dmode.com/javastuff/jogl-swt-example.zip

The example can be run in Windows via swt-example.cmd or swt-example.exe (Java Windows launcher).
The program should produce a simple native window with a tree control at the left hand side and a panel rendering a blinking rectangle at right.

I've successfully tested the example with ATI X800 Pro card - please report if you find any bugs or unstability in the program.

Have fun!  Wink

8  Java Game APIs & Engines / JOGL Development / Re: Using a GLCanvas with SWT ? on: 2005-05-27 07:37:28
Hi, I experimented with JOGL and SWT quite extensively about a year ago. I can post you the details later on today (I'm in a hurry atm).

Cheers
9  Java Game APIs & Engines / JOGL Development / Re: Really stuck on sphere mapping. on: 2005-04-26 13:15:04
Hi, I have been successful with the following piece of code:

[CODE]
       gl.glEnable(GL.GL_DEPTH_TEST);
       gl.glDepthFunc(GL.GL_LEQUAL);
       gl.glEnable(GL.GL_TEXTURE_2D);

       // Sphere reflection mapping
       gl.glEnable(GL.GL_TEXTURE_GEN_S);
       gl.glEnable(GL.GL_TEXTURE_GEN_T);
       gl.glTexGeni(GL.GL_S, GL.GL_TEXTURE_GEN_MODE, GL.GL_SPHERE_MAP);
       gl.glTexGeni(GL.GL_T, GL.GL_TEXTURE_GEN_MODE, GL.GL_SPHERE_MAP);
[/CODE]

Edit: I would try to remove those texture matrix mode tricks first...

Cheers
10  Java Game APIs & Engines / JOGL Development / Re: some startup questions about Jogl on: 2005-03-17 06:51:00
SDV, take a look at a recent discussion about non-pow-2 textures:

http://www.java-gaming.org/cgi-bin/JGNetForums/YaBB.cgi?board=jogl;action=display;num=1110639195
11  Java Game APIs & Engines / JOGL Development / Re: OpenGL question: material and scaleing on: 2005-03-17 06:46:16
I think that this has something to do with the fact that scaling the triangle actually affects its vertices world coordinates and thus the specular highlight computation (since the specular computation is affected by the current viewpoint, vertex position and light position).

Hope this makes some sense.

Edit: You could try to place the light at some distance from the triangle to the direction of the triangle normal. That way, the specular highlights should be equally strong with all scales of the triangle.
12  Java Game APIs & Engines / JOGL Development / Re: I've tried JOGL on: 2005-03-16 08:26:38
I've use GL_TEXTURE_RECTANGLE_EXT with both Radeon 9600 and X800 and it seemed fast to me. See an example here:

http://www.java-gaming.org/cgi-bin/JGNetForums/YaBB.cgi?board=LWJGL;action=display;num=1098038144
13  Java Game APIs & Engines / JOGL Development / Re: Minimal JOGL on: 2005-03-01 06:45:17
Quote
Is it possible at
all? How about signed applets?


It's possible, though not convenient. Take a look at this:

http://www.javaranch.com/newsletter/200310/NativeLibraryInstallTutorial.html

ps. If you haven't already compressed your native libraries, you can use UPX for that:

http://upx.sourceforge.net/

Cheers
14  Java Game APIs & Engines / JOGL Development / Re: Loading model from .obj file problem on: 2005-02-27 13:48:42
Quote

Though really, this sort of thing is a complete PITA to deal with. The current importer I'm using for my models, both animated and static, doesn't have ANY of these checks, because I assume the model exported from my modeller is going to be of the correct format.


Agree 100%. It's not worth it really. My model importers assumes certain formats, which is OK because the modelling tools (MAX, etc.) have their own standards anyway.
15  Java Game APIs & Engines / JOGL Development / Re: JOGL Cross platform question on: 2005-02-26 10:37:20
I think that the easiest (and only) way of getting JOGL work on the platform your friend is using, is to compile JOGL on that platform. Basically, it should not be that difficult - download the source code from (latest, JOGL b09 source release):

https://jogl.dev.java.net/files/documents/27/11497/jogl-src.zip

The source code package comes with the necessary build scripts for the X11 windowing system and thus it should be possible to build it with virtually any standard UNIX system.

The package also comes with a file called HowToBuild.html (in the doc directory), which describes the building process in more detail.





16  Java Game APIs & Engines / JOGL Development / Re: ATI and lightweight acceleration? on: 2005-02-14 20:51:16
Quote
This fix will be present in 1.1 b09.


To quote The Fast Show: Grrreaat.

17  Java Game APIs & Engines / JOGL Development / Re: Time based animitaion on: 2005-02-14 16:30:00
Quote
I have a sprite that the user controlls and he moves using time based movement.  My question is how can i make the actual animation frames time based.


To "bind" your animation to the real world time, you should first ask yourself, what is the desired duration of each frame in the animation. Let's say we want an animation where the frame is changed every 100ms (1/10 of a second), and there are 20 frames altogether:

[CODE]
// The current real world time, in milliseconds
long time = System.currentTimeMillis();

// The current animation frame ((time / duration) mod totalnumberofframes)
int animationFrame = (int) ((time / 100) % 20);
[/CODE]

Hope this helps a bit




18  Java Game APIs & Engines / JOGL Development / Re: ATI and lightweight acceleration? on: 2005-02-14 16:09:18
Quote

Does anyone, with any ATI configuration managed to see improved lightweight performance? Does anyone know if  this is a general driver problem for ATI cards?


I can confirm the same results with an ATI system. I have tried the demo with NVidia setup too, it seems to work great.

My ATI system specs:

- Latest Sun JRE 5.0
- ATI Radeon X800 Pro, with latest (5.2) Catalyst drivers
- WinXP, SP2
- AMD XP 3000+

The demo seems to update the OpenGL panel 1 or 2 times per second, so it clearly suffers of some problems. Notice that I'm using the default OpenGL driver settings.



19  Java Game APIs & Engines / JOGL Development / Re: So you like Textures eh? Texturing Demo in JOG on: 2005-01-18 10:39:15
Quote
hi there,

saw the "get2Fold" method in the TextureLoader. I am using the following elegant code snippet for this job

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
      /**
       * Generates the next power of two.
       * @param in An int.
       * @return The next power of two.
       */

      public static final int nextPowerOf2(int in)
      {
             in -= 1;

             in |= in >> 16;
             in |= in >> 8;
             in |= in >> 4;
             in |= in >> 2;
             in |= in >> 1;

             return in + 1;
      }


got this from a c library, actually, i currently don't know, which one it was. if you guys want to know, i can search for it.


That's quite nice. I deduced a version of my own some time ago (next power of two, downwards):

[CODE]
   private static int getPowerOfTwo(int a)
   {
       return (int) Math.pow(2, (int) (Math.log(a) / Math.log(2)));
   }
[/CODE]
20  Java Game APIs & Engines / JOGL Development / Re: printing frame content? on: 2005-01-14 02:38:59
It would be nice if JOGL included an utility method for these kinds of needs. It seems that this code is asked for once a week now Smiley .
21  Java Game APIs & Engines / JOGL Development / Re: Sphere mapping pain. on: 2005-01-14 02:36:46
Quote

ahh... this allows you to rotate the texture coords.


Quite true, but you don't need that for sphere mapping.  Here's an example:

[CODE]
       if (sphereMap)
       {
           gl.glEnable(GL.GL_TEXTURE_GEN_S);
           gl.glEnable(GL.GL_TEXTURE_GEN_T);
           gl.glTexGeni(GL.GL_S, GL.GL_TEXTURE_GEN_MODE, GL.GL_SPHERE_MAP);
           gl.glTexGeni(GL.GL_T, GL.GL_TEXTURE_GEN_MODE, GL.GL_SPHERE_MAP);
       }
       else
       {
           gl.glDisable(GL.GL_TEXTURE_GEN_S);
           gl.glDisable(GL.GL_TEXTURE_GEN_T);
       }
[/CODE]
22  Java Game APIs & Engines / JOGL Development / Re: "On-demand" mode modification to tut on: 2005-01-12 06:05:49
Quote
But how do I make it show anything before the first mouse or key event?


What keeps you from calling glCanvas.repaint() right after you've created it? Smiley

Remember, that repaint method does not cause an immediate refresh of the component but an event that requests the refresh in the AWT thread.
23  Java Game APIs & Engines / JOGL Development / Re: "On-demand" mode modification to tut on: 2005-01-10 07:35:00
Pahidla, you must be referring to this thread:

http://www.java-gaming.org/cgi-bin/JGNetForums/YaBB.cgi?board=jogl;action=display;num=1103394116

...in that case, my bad, sorry - I did promise to deliver a simple example that shows the basic usage of "on-demand" usage of JOGL (manual refreshing of GLDrawables).

The thing is I've been busy with my studies lately - I'm currently working on a 100% Java rigid body dynamics framework/library.

But, if there is any specific question about JOGL, that I could help you with, please do ask without hesitation.

24  Java Game APIs & Engines / JOGL Development / Re: Capture scene and draw it back as texture on: 2005-01-09 14:24:47
See this thread at LWJGL forum:

http://www.java-gaming.org/cgi-bin/JGNetForums/YaBB.cgi?board=LWJGL;action=display;num=1098038144

...it contains source code for a motion blur effect which I wrote some time ago. Basically it shows how to make use of non-power-of-two textures. Hopefully you can modify it to fit your needs.
25  Java Game APIs & Engines / JOGL Development / Re: Webstart grief on: 2004-12-21 10:46:47
The one not working has wrong content-type, "text/plain". It should be:

application/x-java-jnlp-file

This can be fixed by altering the server configuration or the script providing the file (php, asp, etc.). The following is an example for Apache configuration:

AddType application/x-java-jnlp-file .jnlp
AddType application/x-java-archive-diff .jardiff


With PHP you can do the following to change the content type:

header('Content-type: application/x-java-jnlp-file');

...and then output the JNLP contents.

26  Java Game APIs & Engines / JOGL Development / Re: Causing the stuff to refresh on: 2004-12-20 15:28:14
Quote
I'm operating in the "on-demand" mode. But I have a problem kicking things off. When the JFrame containing my GLCanvas comes up, the init() or display() are _not_ called. In order to trigger them, I have to manually resize the window and then everything gets going.


Thank you for your kind words.
Can you post your initialization code here (Frame/GLCanvas creation, etc.), so we can take a look at it?

27  Java Game APIs & Engines / JOGL Development / Re: Causing the stuff to refresh on: 2004-12-20 07:08:06
Ok, I'll try to explain JOGL and threads in a clear way. Generally, there are two ways in which you can use JOGL to render graphics:

- On-demand -> the GLDrawable (GLCanvas, etc.) is only refreshed when the repaint/display is called by AWT (component resized, etc.) or by the user.

- Continuous -> the GLDrawable is continuously refreshed by another thread (Animator class, etc.).

The possible problems with threads arise when two different threads try to operate on the same OpenGL context.

In JOGL terms, this basically means that if you're rendering the GLDrawable with an Animator (or some other implementation involving multithreading) AND try to invoke OpenGL operations on the same GLDrawable from another thread, problems will occur.

However, if you're only refreshing the GLDrawable manually (no threading involved), it's OK to make OpenGL calls from the GUI thread, since no other thread is using the GLDrawable and its OpenGL context anyway.

So pahidla, you're doing nothing wrong. Smiley
28  Java Game APIs & Engines / JOGL Development / Re: Causing the stuff to refresh on: 2004-12-19 17:37:20
I'll post you a simple example tomorrow morning (Finnish time that is [GMT+2] Smiley )
29  Java Game APIs & Engines / JOGL Development / Re: Determine the color of pixel on: 2004-12-18 07:39:08
Quote
...and

does the callback of a button count as another thread?


Yes, in the AWT/Swing world, the button event is executed in the GUI thread, which probably is not the same thread you're using JOGL from right now.

To go around this, it is easiest to "delay" and delegate the button event to the rendering thread, using a queue of events, for example. So, in general:

1. Event occurs (button was pressed, mouse was moved, etc.)

2. Delegate the event to the queue (you can simply put the event object to the queue)

3. Rendering thread sees that the queue is non-empty and processes the events in the queue (responds to the pressed button, etc.)

I hope this helps
30  Java Game APIs & Engines / JOGL Development / Re: [Announcement] JSR-231 and JOGL on: 2004-12-17 07:10:58
Ken, that is truly excellent news!

This kind of information is exactly what the community needs to see.
Pages: [1] 2 3 ... 5
 

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

The first screenshot will be displayed as a thumbnail.

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

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

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

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

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

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

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

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

Longarmx (34 views)
2014-09-07 01:10:19

mitcheeb (40 views)
2014-09-04 23:08:59
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!