Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - AGP

Pages: 1 ... 101 102 [103] 104 105 ... 116
1531
Support / Re: Hardware jpct-lwjgl Applets
« on: April 24, 2009, 10:29:39 am »
Living and learning. Done.

EDIT: And the Joystick Wiki is gone. Was it because I renamed it (duh!)?
EDIT: Added it again, so don't worry about it.

1532
Support / Re: Performance Loss With Rendering 3D-2D-3D
« on: April 24, 2009, 09:58:05 am »
Thanks a lot.

1533
Support / Re: Hardware jpct-lwjgl Applets
« on: April 24, 2009, 09:36:46 am »
I'll add it again. But how did I destroy the main page? And I didn't use tags at all (other than the html tags).

EDIT: Used your <pre> tag suggestion and it looks fine now. Can you create me a new page for the html heap size suggestion?

1534
Support / Re: Performance Loss With Rendering 3D-2D-3D
« on: April 24, 2009, 08:10:41 am »
No, I know I have to render scene too. Could you guess how much slower it would perform with the software (OpenGL mode) renderer?

And to answer your question, so that I can set only the hero in the game to visible. But in a different scenario, you might be unsure of whether you have invisible objects (or otherwise be sure you have several) and will then get to set everything to visible.

1535
Support / Re: Hardware jpct-lwjgl Applets
« on: April 24, 2009, 08:07:40 am »
Sure, will do.

EDIT: Done. And I added a bit about specifying the applet heap size via HTML. If somebody could format the whole thing so it looks right, I'd appreciate it.

1536
Support / Performance Loss With Rendering 3D-2D-3D
« on: April 24, 2009, 04:23:40 am »
I'm writing a 2.5D RPG engine and sometimes a 2D object will have to be in front of some 3D ones, and behind others. I expect I'll draw the FrameBuffer, then get its graphics and draw the 2D object, then set all the behind 3D objects to invisible and draw the buffer again. Is that insanely slow? And Egon, a small request: World.setAllVisible(boolean), so that I need not know what's added to the world to set everything to invisible.

1537
Support / Re: Hardware jpct-lwjgl Applets
« on: April 24, 2009, 04:18:31 am »
Thanks, maybe I'll change it a little bit (things like addressing the URL instead of the file) and post it there.

EDIT: Then again, I looked at the wiki and it seems that Paulscode has already put a nice example.

1538
Support / Re: Hardware jpct-lwjgl Applets
« on: April 23, 2009, 09:01:35 am »
Yup, I didn't want to post code, then I figured it was actually a good thing. It's a simple applet and it's nice to have a simple example to show anyone who might be starting.

1539
Support / Re: Hardware jpct-lwjgl Applets
« on: April 23, 2009, 05:39:59 am »
Thanks, I always seem to get stuck on the little things. theCanvas.repaint() did it. And a little note: I wasn't polling the joystick, so if anyone is looking at this code, before
Code: [Select]
joys.getYAxisValue() is called,
Code: [Select]
joystick.poll() should be.

1540
Support / Hardware jpct-lwjgl Applets
« on: April 23, 2009, 12:33:47 am »
I'm trying to make hardware jpct-lwjgl applets that use the joystick and 3D hardware. All three of the first ones have failed to render anything to the screen (except for when on the third one I was using jpct's software renderer). Check out the code of this incredibly simple applet and remember it worked on software rendering (without the canvas). As it is, I get a black screen (nothing renders). By the way, although I'm only using ambient light on this one, the other two had other lights positioned around the world.

Code: [Select]
import java.applet.*;
import java.awt.*;
import com.threed.jpct.*;
import com.threed.jpct.util.Light;
import org.lwjgl.opengl.*;
import org.lwjgl.input.*; //JOYSTICK AND OPENGL-MODE KEYBOARD

public class SimpleApplet3D extends Applet implements Runnable {
      private Object3D object;
      private World theWorld;
      private FrameBuffer buffer;
      private Camera theCamera;
      private boolean keepGoing;
      private Controller joystick;
      private Canvas theCanvas;

      public void init() {
object = Loader.load3DS("c:/MyPrograms/3D/SimpleApplet/Girl.3DS", 1f)[0];
buffer = new FrameBuffer(800, 600, FrameBuffer.SAMPLINGMODE_NORMAL);
buffer.enableRenderer(IRenderer.RENDERER_OPENGL);
buffer.disableRenderer(IRenderer.RENDERER_SOFTWARE);
Config.maxPolysVisible *= 3;
theWorld = new World();
theCamera = theWorld.getCamera();
this.add(theCanvas = buffer.enableGLCanvasRenderer());
Controllers controllers = new Controllers();
try {
      controllers.create();
      if (controllers.getControllerCount() > 0) {
joystick = controllers.getController(0);
System.out.println("Got the joystick. Its name: "+joystick.getName());
      }
}
catch (org.lwjgl.LWJGLException e) {}
theWorld.addObject(object);
theWorld.setAmbientLight(65, 65, 65);
keepGoing = true;
      }
      public void start() {
Thread appletLoop = new Thread(this);
appletLoop.start();
      }
      private void draw() {
buffer.clear(Color.black);
theWorld.renderScene(buffer);
theWorld.draw(buffer);
buffer.display(theCanvas.getGraphics());
// buffer.displayGLOnly();
      }
      public void run() {
while (keepGoing) {
      if (joystick != null) {
theCamera.moveCamera(Camera.CAMERA_MOVEIN, joystick.getYAxisValue());
      }
      draw();
      try {
Thread.sleep(50);
      }
      catch (InterruptedException e) {}
}
      }
      public void stop() {
keepGoing = false;
      }
      public void destroy() {}
}

1541
Support / Re: lwjgl Joystick
« on: April 16, 2009, 10:14:44 pm »
Actually, in this case I'm referencing lwjgl directly (no jPCT). But I must be thinking more clearly today than I was yesterday because I solved it. Thanks for your help, pal.

1542
Support / Re: lwjgl Joystick
« on: April 16, 2009, 09:50:00 pm »
I figured it out. Part of it is the fact that although it compiles with just a reference to lwjgl.jar, to run you have to reference jinput.jar. Plus, Vista x64 is giving me a headache. I can't wait for EVERYTHING to be 64-bit already.

Here's another joystick-related question: I wrote years ago a Java 2D game which only used the keyboard. Yesterday I decided to add the lwjgl joystick to it, so instead of drawing into the awt frame I added the AWTGLCanvas to the frame and drew on the canvas. This time I initialize the controllers just fine and even get a Controller instance. But when I poll the joystick for input, its value are always -1. I realize this question belongs in the lwjgl boards but there are a lot more people here.

1543
Support / Re: lwjgl Joystick
« on: April 16, 2009, 08:30:07 pm »
I know, I realized it as I typed it here. But that's the code that runs the joystick. The other one just throws an LWJGLException (which I catch), so nothing happens but I can't access the joystick.

1544
Support / lwjgl Joystick
« on: April 16, 2009, 08:20:45 pm »
I have two programs. One uses an AWT window and initializes the FrameBuffer like this:
Code: [Select]
buffer = new FrameBuffer(width, height, SAMPLINGMODE_NORMAL);
buffer.enableRenderer(IRenderer.MODE_OPENGL);
Then (after World.renderScene(buffer) and World.draw(buffer)) calls buffer.display(Graphics). The other, like this:
Code: [Select]
buffer = new FrameBuffer(width, height, SAMPLINGMODE_HARDWARE_ONLY);
buffer.enableRenderer(IRenderer.RENDERER_OPENGL);
then makes only buffer.displayGLOnly() calls. Oddly, the first program initializes and uses the lwjgl joystick succesfully whereas the second one can't get past controllers.create()! Why oh why?

1545
Support / Re: Is it possible to support JoGL?
« on: April 16, 2009, 08:10:56 pm »
Also, from what I understand, lwjgl supports OpenGL 3.0 whereas JoGL only supports 2. Still, I'm getting my ass kicked by an lwjgl applet (their appletloader system is clever but doesn't seem to work all the time), so maybe JoGL can help there. Again, Egon, I appreciate all you do here a whole lot. So thanks.

Pages: 1 ... 101 102 [103] 104 105 ... 116