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 ... 98 99 [100] 101 102 ... 116
1486
Support / Re: When does ArrayIndexOutOfBoundsException get thrown?
« on: June 11, 2009, 11:08:48 pm »
Oh, for some reason I thought displayGLOnly() could only be used with the lwjgl frame. So I changed back to repaint() and used displayGLOnly() and that did it, thanks. And I was using paint(Graphics) in an effort to avoid the error, which was being caused even when repaint() was called with the display(canvas.getGraphics()) call.

1487
Support / When does ArrayIndexOutOfBoundsException get thrown?
« on: June 11, 2009, 07:42:56 pm »
Since I went from the lwjgl window to the AWTGLCanvas (to get access to awt.Graphics) I've been getting this exception thrown at random times in my program a few seconds into it. I imagine it's some sort of thread synchronization issue, but I'm not quite sure how to solve it. The following are the lines that seem to cause it:
Code: [Select]
else {//IF HARDWARE RENDERER
      Graphics canvasG = awtGlCanvas.getGraphics();
      buffer.display(canvasG);
      this.paint(this.getGraphics());
      awtGlCanvas.paint(canvasG);
}

1488
Support / Re: Can't Get this Simple Appet to Work Online
« on: June 09, 2009, 11:43:34 pm »
Thanks Egon and paulscode. Paulscode, the file was in the jar, I just meant that it was also in that folder so that I didn't know which one was being loaded locally. And Egon, you needed Data.jar for the music, which plays fine. But it did finally work.

1489
Support / Re: Can't Get this Simple Appet to Work Online
« on: June 09, 2009, 09:03:00 pm »
That's good to know you're not blocking me lol. The lzma stuff is the lwjgl applet package. You should really download it. And no, I tried the getResourceAsStream as well. Same message.

1490
Support / Re: Can't Get this Simple Appet to Work Online
« on: June 09, 2009, 08:46:04 pm »
REMOVED THE LINK (WEB SITE ISN"T READY YET)

1491
Support / Re: Can't Get this Simple Appet to Work Online
« on: June 09, 2009, 08:32:25 pm »
It tells me it's an invalid 3ds file. I sent you the jar.

1492
Support / Can't Get this Simple Appet to Work Online
« on: June 09, 2009, 08:16:33 pm »
Locally it runs fine (although it just occurred to me that the jaguar.3DS file is in the same folder as the jar). I've tried variations of the Loader.load3DS line and none of them work either.

Code: [Select]
import java.awt.*;
import java.applet.*;
import com.threed.jpct.*;

public class RacerMusic extends Applet {
      private FrameBuffer buffer;
      private World theWorld;
      private Object3D car;
      private Camera camera;
      private AudioClip music;
      private float cameraToObjectDistance, cameraDisplacement;

      public void init() {
try {
     music = Applet.newAudioClip(this.getClass().getResource("TheSign.wav"));
}
catch (Exception e) {}
buffer = new FrameBuffer(800, 600, FrameBuffer.SAMPLINGMODE_NORMAL);
buffer.enableRenderer(IRenderer.RENDERER_SOFTWARE);
Config.maxPolysVisible = 250000;
Config.collideOffset = 500;
Config.oldStyle3DSLoader = true;
theWorld = new World();
theWorld.setAmbientLight(100, 100, 100);
camera = theWorld.getCamera();
car = Object3D.mergeAll(Loader.load3DS(this.getClass().getResource("./jaguar.3DS"), "jaguar.3DS", 1f));
theWorld.addObject(car);
theWorld.buildAllObjects();
System.out.println("Got this far (past loading the model).");
follow();
System.out.println("Got this far. 2");
      }
      private void follow() {
Matrix matrix = car.getWorldTransformation().invert3x3();
camera.setBack(matrix);
camera.setPosition(car.getTransformedCenter());
camera.rotateCameraX((float)Math.toRadians(100+cameraDisplacement));
camera.moveCamera(Camera.CAMERA_MOVEOUT, cameraToObjectDistance);
      }

      public void paint(Graphics g) {
if (buffer == null || theWorld == null)
     return;
buffer.clear(Color.black);
theWorld.renderScene(buffer);
theWorld.draw(buffer);
buffer.display(g);
      }

      public void start() {
music.loop();
      }
      public void stop() {}
      public void destroy() {}
}

EDIT: The HTML file (I want it to run via AppletLoader):
Code: [Select]
<html>
  <applet code="org.lwjgl.util.applet.AppletLoader" archive="lwjgl_util_applet.jar, lzma.jar" codebase="."

width="800" height="600">
    <param name="java_arguments" value="-Xmx320m">
    <param name="al_title" value="Racer Music v. 0.1">
    <param name="al_main" value="RacerMusic">
    <!-- logo to paint while loading, will be centered -->
    <param name="al_logo" value="Car.gif">
    <!-- progressbar to paint while loading. Will be painted on top of logo, width clipped to percentage done -->
    <param name="al_progressbar" value="appletprogress.gif">
   
    <!-- signed windows natives jar in a jar -->
    <param name="al_windows" value="windows_natives.jar.lzma">

    <!-- List of Jars to add to classpath -->
    <param name="al_jars" value="RacerMusic.jar, Data.jar, jpct.jar, lwjgl_applet.jar.pack.lzma,

lwjgl.jar.pack.lzma, jinput.jar.pack.lzma, lwjgl_util.jar.pack.lzma, res.jar.lzma">
   
    <!-- signed linux natives jar in a jar -->
    <param name="al_linux" value="linux_natives.jar.lzma">
   
    <!-- signed mac osx natives jar in a jar -->
    <param name="al_mac" value="macosx_natives.jar.lzma">

    <!-- signed solaris natives jar in a jar -->
    <param name="al_solaris" value="solaris_natives.jar.lzma">
   
    <!-- Tags under here are optional -->
   
    <!-- Version of Applet, important otherwise applet won't be cached, version change will update applet, must be

int or float -->
    <!-- <param name="al_version" value="0.1"> -->
   
    <!-- background color to paint with, defaults to white -->
    <!-- <param name="al_bgcolor" value="000000"> -->
   
    <!-- foreground color to paint with, defaults to black -->
    <!-- <param name="al_fgcolor" value="ffffff"> -->
   
    <!-- error color to paint with, defaults to red -->
    <!-- <param name="al_errorcolor" value="ff0000"> -->
   
    <!-- whether to run in debug mode -->
    <!-- <param name="al_debug" value="false"> -->
   
    <!-- whether to prepend host to cache path - defaults to true -->
    <param name="al_prepend_host" value="false">

  </applet>

  <p>
    if <code>al_debug</code> is true the applet will load and extract resources with a delay, to be able to see the

loader process.
  </p>

  </body>
</html>

1493
Support / Re: A Little Trigonometry
« on: June 06, 2009, 10:33:05 pm »
Egon, THANKS A WHOLE LOT. Works great. I'll try and get the applet up and running by tonight to show it to you. It's a good lesson, too, this doing it by matrices, for future programs. I appreciate it, pal.

1494
Support / Re: A Little Trigonometry
« on: June 05, 2009, 07:41:58 pm »
Rotating obviously messed everything up. What about world.rotateAxis(world.getXAxis(), float) methods? I think it would be very handy.

1495
Support / Re: A Little Trigonometry
« on: June 05, 2009, 07:13:28 pm »
Yeah, but it's not like I rotated any of the models. X/Y is just what I ended up with when I loaded them. Anyway, of my Quest for Glory you wrote the opposite, because I have an X/Z plane and I remember you saying that the mouse-walking method had been meant for X/Y. So should I rotate everything -90 degrees along their x-axis?

1496
Support / Re: A Little Trigonometry
« on: June 05, 2009, 07:02:55 pm »
Never mind my question, I can see it in your loading code. So then, can you explain the rest to me?

1497
Support / Re: A Little Trigonometry
« on: June 05, 2009, 06:38:07 pm »
I understand so little of this code it's hard to plug it into my program. Let's start with what part of this converts between X/Z and X/Y?

1498
Support / Re: A Little Trigonometry
« on: June 05, 2009, 10:07:02 am »
No, that's what it ought to look like. The cars are moving on the X/Y plane with +Z going up. And, like I said, the car is following the tracks nicely.

1499
Support / Re: A Little Trigonometry
« on: June 05, 2009, 09:56:03 am »
Sorry, I forgot to tell you that the first 4 bytes are an int that informs us how many SimpleVectors (not floats) are stored.

1500
Support / Re: A Little Trigonometry
« on: June 05, 2009, 09:36:24 am »
I e-mailed it to you. It's not an ASCII, but all you need is DataInputReader to read the floats.

Pages: 1 ... 98 99 [100] 101 102 ... 116