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 - EgonOlsen

Pages: 1 ... 803 804 [805] 806 807 ... 823
12061
Support / Using mouse in jPCT applet version
« on: May 14, 2004, 04:07:08 pm »
What is mouseClick()? I suggest to overwrite

Code: [Select]
protected void processMouseEvent(MouseEvent e)

in the applet with something like:

Code: [Select]

protected void processMouseEvent(MouseEvent e) {
   super.processMouseEvent(e);
   if (e.getID()==MouseEvent.MOUSE_CLICKED) {
      wire=!wire;
   }
}


That should work. You shouldn't abuse processKey() for mouse events, because it was meant to handle events from the keyboard, not from the mouse.

12062
Support / Selectable objects
« on: May 12, 2004, 05:20:29 pm »
Yes, you have to get x and y of your mouse. In an applet, overwriting processMouseMotionEvent(MouseEvent e) or processMouseEvent(MouseEvent e) from Component should work (depends if you want to get an Event in case of a click or everytime the mouse moves...maybe both...). You can then query the MouseEvent for x and y.

The picking already returns the object's ID. You can obtain it simply by calling Interact2D.getObjectID(res). You don't have to ask the world for the object with ID x and ask the returned object for its ID afterwards. Both IDs are the same in this case.

Hope this helps.

12063
Support / MD2 file
« on: May 12, 2004, 05:04:06 pm »
Should be quite easy in this case. You load and place the object like every other and animate it. Basically like this:

Code: [Select]
Object3D objAnim=Loader.loadMD2("md2/tris.md2", 1f);
TextureManager.getInstance().addTexture("myTexture", new Texture("md2/texture.jpg"));
objAnim.setTexture("myTexture");
objAnim.build();
theWorld.addObject(objAnim);
.
.
.
objAnim.animate(index, sequenceNumber);


Where index is a value between 0 and 1 and sequenceNumber the number of the animation sequence. Have a look at the Javadocs for more details about this.

Hope this helps.

12064
Support / MD2 file
« on: May 11, 2004, 11:43:41 pm »
Code/docs for using jPCT's MD2-support or for writing your own loader in whatever language?

12065
Support / Switching renderer in an applet context
« on: May 11, 2004, 11:40:55 pm »
Well, it's of course impossible to render directly into the applet, but i thought that it may be possible to open the LWJGL-window from within the applet. Anyway, a system that could probably do that can do webstart as well... :wink:

12066
Support / Switching renderer in an applet context
« on: May 10, 2004, 07:14:14 pm »
No, hardware and software renderer can both do the same things. Software is just slower and doesn't look as good as hardware. But it will run everywhere, where Java1.1 is installed (including IE or NS4.7).
If you are using applets, maybe the old applet example is of interest for you. I've removed it from the distribution because it was outdated and ugly, but it's still available in this package (it's called bounce): http://www.jpct.net/download/jpctapi_096.zip
It should include some keyboard related stuff for applets. Please use just the example from this package, not the whole api.

12067
Support / Switching renderer in an applet context
« on: May 10, 2004, 06:25:54 pm »
Webstart is SUN's "replacement" for applets (since Java 1.2.2 or so), i.e. a way to distribute and launch applications via a network. I made some small webstart demos using jPCT. They can be found here (you need at least Java 1.3 to run them):

http://www.jpct.net/forum/viewtopic.php?t=134

All you do is to write a small XML-file that tells Java webstart what to download and what to start. I can give you a sample XML if you are interested.

12068
Support / Switching renderer in an applet context
« on: May 10, 2004, 05:06:15 pm »
Short answer: I don't know. I never tried it. Even if it is possible somehow to make the applet access the LJWGL-DLL, this would limit your applet to Windows and you would have to sign it.
I suggest to use Webstart instead. It's easy to work with and you can make sure that every OS gets the correct native libs.

12069
Support / Ray/polygon collision
« on: May 09, 2004, 01:04:10 pm »
I recently discovered two bugs in 1.00. On in the CollisionListener and one in the ray-polygon-collision itself. I'm not sure if they may cause the behaviour you describe, but it could be worth a try to use this version:

*Link removed*

It's a pre-1.01 with both bugs fixed. If it's still not working, try to adjust collideOffset in Config. Personally, i'm using the ray-polygon detection for exactly the same thing ATM (have a look at the "new example" thread in the news-section) and it works fine.

Edit: Docs for this version can be found here: *Link removed*

12070
News / Working on new example
« on: May 04, 2004, 11:47:17 pm »
Still working on it...the "car" can now fire bullets which are leaving decals on the terrain's surface.



Edit: New terrain texture

12071
Projects / Game I'm soon to make
« on: May 04, 2004, 07:40:15 pm »
Sounds very interesting. Is this somehow related to the RPG that can already be found on gamelizard.com? If i just had the time to make something like this myself. Reminds me of the stuff i did on the Amiga a decade ago. I would really like to revive this game (http://amiga.emucamp.com/quelle.htm) using jPCT but i'm busy maintaining the engine itself. :(

12072
Support / Displaying textures & objs problem in applet context
« on: May 04, 2004, 05:46:40 pm »
Maybe your naming when adding the textures to the manager doesn't match the naming of the textures in the material. The fps-example loads and adds them with their complete name, i.e. "car1.jpg", while in your applet example, you simply named the texture "car1".
Have a look at the console output...does the loader prints out some messages like

Texture named blahblah.jpg added to TextureManager!

? If so, your naming is definitely not correct and your should add your textures using the exakt name that's defined in the material.

12073
News / Working on new example
« on: April 29, 2004, 10:18:18 pm »
Just to prove that i'm still working on the new example...it can do simple skidmarks now:


12074
Support / Problem importing 3ds files into applet
« on: April 29, 2004, 03:56:13 pm »
3DS is fine for applets. You just have to take care that you are using the appropriate method to load it. The Loader-class offers three variants for each kind of model. One is for applications, one for applets (the one with the document base) and one for input streams. For an applet, you may use the applet  version (the document base can be obtained from the applet by calling this.getDocumentBase()) or you include your model into a JAR and load it using an input stream (this.getClass ().getResourceAsStream("....") or similar). That will work with applications, applets and webstartable application, so it may be the better choice in the long run.
BTW: Don't use "\" as a separator in your path but "/" when loading from within your applet.

Hope this helps.

12075
Support / 3D points/lines and polygon normals
« on: April 28, 2004, 10:01:52 pm »
Quote from: "Musurca"
For example, if you were bouncing a ball on a jagged surface, and you wanted to figure out the direction in which the ball would rebound after impact, you'd definitely need to figure out the polygon normal quickly.
FYI: The new version (1.00+) offers a way to get this information (normals and vertices of single polygons in world space) via an object's "PolygonManager".

Pages: 1 ... 803 804 [805] 806 807 ... 823