Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (539)
Games in Android Showcase (132)
games submitted by our members
Games in WIP (604)
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: scene graph traversal, and node design on: 2006-09-26 03:22:39
Ok, I'm no guru, but here's my opinions none-the-less:

If you are designing a scenegraph, then most probably you will be concerned about culling large parts of the graph when possible, eg: the traditional quad-tree terrain where if your camera is facing east, and you are east of the midpoint, you can instantly discard 2 of the 4 initial child nodes.  So, you are going depth-first, and testing whether to traverse further at each node.

You're always moving down the tree, never going up (until you exhaust the children of the current node), so by virtue of this fact you will always have access to the "parent" node.  Therefore you only need one-way references to the child nodes.
2  Java Game APIs & Engines / JOGL Development / Re: Project Presentation: The Javascriptorium on: 2006-08-30 01:29:08
That looks really impressive.  Great aesthetics.  I'll look forward to seeing the animated verison.
3  Java Game APIs & Engines / JOGL Development / Re: Accessing GL from keyPressed() method on: 2006-08-30 01:23:55
Thankyou gentlemen.
4  Java Game APIs & Engines / JOGL Development / Re: Accessing GL from keyPressed() method on: 2006-08-29 07:49:36
I'm trying to implement frustum culling, that's why I want to get the model-view matrix only when input is received, rather than in display() 

...so I'm guessing that those who have gone before me and done frustum culling with JOGL have chosen the 'geometric' approach where you get the 8 points from your camera class instead?  Sounds like it would be more efficient...
5  Java Game APIs & Engines / JOGL Development / Accessing GL from keyPressed() method on: 2006-08-24 05:22:07
Hi All,

I am trying to access the GL object as follows from a GLCanvas object i hold as member variable:

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
    public void keyPressed(KeyEvent e)
   {
      System.out.println(angle);
      if (e.getKeyCode() == KeyEvent.VK_UP)
         angle += 1f;
      if (e.getKeyCode() == KeyEvent.VK_DOWN)
         angle -= 1f;
     
      examineModelViewMatrix(canvas.getGL());
   }


However, I read the following within GLCanvas javadoc:
Quote
Returns the GL pipeline object this GLAutoDrawable uses. If this method is called outside of the GLEventListener's callback methods (init, display, etc.) it may return null. Users should not rely on the identity of the returned GL object; for example, users should not maintain a hash table with the GL object as the key. Additionally, the GL object should not be cached in client code, but should be re-fetched from the GLAutoDrawable at the beginning of each call to init, display, etc

And this is clearly the case as my modelview matrix is all zeros when i try to access it in this way, whereas if i access it in display(), for instance, i get a matrix in the form one would expect after rotation is applied.

So, who can tell me how to access the GL from input callback methods?
6  Java Game APIs & Engines / JOGL Development / Re: Announcing: joglutils project on: 2006-08-05 06:09:26
Do you have a website for the project yet?
7  Java Game APIs & Engines / JOGL Development / Re: Is this timer any good? on: 2006-08-01 02:03:23
Thanks Riven.  I've taken your advice.
8  Java Game APIs & Engines / JOGL Development / Is this timer any good? on: 2006-07-31 03:03:40
Hi All,

I've been thinking about timers a bit lately and came up with this...

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  
package org.kramer.utils;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

/**
 * Internally uses nanoseconds due to Java 1.5's System.nanoTime() being more
 * accurate. The public interface is in milliseconds though for convenience.
 *
 * TODO: add support for one-off events, look into threading
 *
 * @author Kramer
 *
 */

public class Timer
{
   private long lastLoopTime = System.nanoTime();
   private List<Event> events = new ArrayList<Event>();

   /**
    * Call this in the display() loop
    */

   public void update()
   {
//      long deltaMillis = (System.nanoTime() - lastLoopTime) / 1000000;
     
      Iterator<Event> it = events.iterator();
      while (it.hasNext())
      {
         Event event = it.next();
         if (event.nextExecution <= System.nanoTime())
         {
            event.nextExecution = System.nanoTime() + (event.frequency * 1000000);
            event.doEvent();
         }
      }
      lastLoopTime = System.nanoTime();
   }
   
   /**
    * @param frequency Frequency in milliseconds
    * @param event
    */

   public void scheduleEvent(long frequency, Event event)
   {
      event.frequency = frequency;
      event.nextExecution = System.nanoTime() + (frequency * 1000000);
      events.add(event);
   }
   

   /**
    *
    */

   public abstract class Event
   {
      long nextExecution;
      long frequency;
     
      public abstract void doEvent();
   }

}


...and in your init() you register events and how frequently you want them to happen as:
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
      Timer timer = new Timer();
      timer.scheduleEvent(500, timer.new Event(){
         public void doEvent() {
            System.out.println("every 500 milliseconds");
         }
      });
      timer.scheduleEvent(100, timer.new Event(){
         public void doEvent() {
            System.out.println("every 100 milliseconds");
         }
      });      


Then call timer.update() in display().

So... does anyone think this is any good?  Would you use it?  If not, please let me know why.

Thanks,
Kramer
9  Java Game APIs & Engines / JOGL Development / Re: Detecting enabled state within shader on: 2006-07-29 08:15:00
Actually, just checked the book and there is a built-in uniform variable that you can access from both types of shaders: gl_FogParameters

Found this reference: http://www.ce.chalmers.se/edu/course/EDA425/glsl_quickref.pdf
10  Java Game APIs & Engines / JOGL Development / Re: Detecting enabled state within shader on: 2006-07-28 03:01:47
Pass it through as a boolean uniform parameter to your shaders from your main code.
11  Java Game APIs & Engines / JOGL Development / Re: 3ds loader and drawer using JOGL on: 2006-07-28 02:59:58

That's a really nice little library you've got there... you should think about making it a bit more pluggable, ie: pluggable renderer, etc

Nice work.
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.

rwatson462 (36 views)
2014-12-15 09:26:44

Mr.CodeIt (27 views)
2014-12-14 19:50:38

BurntPizza (61 views)
2014-12-09 22:41:13

BurntPizza (96 views)
2014-12-08 04:46:31

JscottyBieshaar (56 views)
2014-12-05 12:39:02

SHC (72 views)
2014-12-03 16:27:13

CopyableCougar4 (74 views)
2014-11-29 21:32:03

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

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

toopeicgaming1999 (35 views)
2014-11-26 15:20:08
Resources for WIP games
by kpars
2014-12-18 19:56:14

Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-10 08:05:00

Definite guide to supporting multiple device resolutions on Android (2014)
by mbabuskov
2014-10-03 08:06:02

List of Learning Resources
by Longor1996
2014-08-16 20:10:00

List of Learning Resources
by SilverTiger
2014-08-06 05:03:27

Resources for WIP games
by CogWheelz
2014-08-02 01:50:17

Resources for WIP games
by CogWheelz
2014-08-02 01:49:50

List of Learning Resources
by SilverTiger
2014-08-01 01:59:50
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!