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 ... 802 803 [804] 805 806 ... 822
12046
Support / A javascript listening problem
« on: May 20, 2004, 12:46:56 pm »
I don't think so. At least i don't know of a way to make Javascript on a web page run when triggered from inside the applet. I suggest to use polling instead. Do something like

Code: [Select]

window.setInterval("pollApplet()",250);
.
.
.
funtion pollApplet() {
    var temp = document.applets[0].feritoID;
    // Do stuff with "temp" here  
}


This will set temp to feritoID every 250ms.

12047
Support / Ray/polygon collision
« on: May 20, 2004, 12:37:21 pm »
Cooool...i'll have a look at your code for sure. The funny things is, that jPCT already has an OBB (i.e. the tranformed AABB) for each object. It's just not public. Maybe it should be...

Currently, it's used for collision detection in a way that rays/spheres/ellipsoids are checked against it before work starts on the polygon level (if it has to, i.e. if there is an intersection).

Anyway, i got the oriented ellipsoid stuff working too. At least i think i did...it requires some more testing. However, i think that your OBB-approach is very well suited for cars, because they are just boxes...basically... :wink:

12048
Support / Interact2D behaviour
« on: May 20, 2004, 12:19:44 pm »
Selectable is default. You don't have to enable selection on desired objects but disable it on all others. What i don't understand is, that the unselectable objects doesn't block the ray to prevent the "rest of the world" from being picked. Then again, i don't know how your world looks like exactly, so i guess that this is a correct behaviour in your case. I double checked the picking code and can't find anything wrong with it.

12049
Support / Interact2D behaviour
« on: May 19, 2004, 05:25:19 pm »
Fine, but i'll look into this 120-issue...i don't see a reason for this behaviour. If nothing has been selected, null should be returned. Not an array containing nonsense values.

Edit: Please let me know if an object with ID=120 really exists (even if you haven't created it yourself). Try to get the actual object with this ID from World by calling getObject(int id). If such object exists, please tell be the name of it (getName()). Or does getObject() returns null and prints out an error?

12050
Support / Interact2D behaviour
« on: May 19, 2004, 04:05:09 pm »
No, 120 isn't a default ID or whatever. If 120 is reported, an object with this ID has been selected, unless the method is faulty which i'm not aware of.
However, it may be related to the fact that you call the picking all the time, not just when a mouse button has been pressed. I assume that your mouse-click-method sets mouseX and mouseY? If so, let it set a flag like "clicked=true" too and do the picking only if this flag is set (and reset it afterwards). See if this fixes your problem.
The picking doesn't care if a mouse button has been pressed or not. It just fires a ray into the scene according to the coordinates you give it. If you do this every frame, so be it...
If the "120"-problem remains, please try to find out which object's ID this is and where it is located.

12051
Support / Using mouse in jPCT applet version
« on: May 19, 2004, 07:26:21 am »
Have you implemented a KeyListener together with the MouseListener?

12052
Bugs / OS X render problems
« on: May 17, 2004, 08:51:28 pm »
It's a fixed version that will work everywhere. The problem was, that i allocated a ByteBuffer in native order, where i should have one allocated in LITTLE_ENDIAN. This works for Intel, because native order is LITTLE_ENDIAN there...but on Mac, native order is BIG_ENDIAN. The ByteBuffer is now always LITTLE_ENDIAN regardless of the system.

About your input problems: This is most likely a LWJGL problem. The fps-example uses two different approaches to query the keyboard. The SUN-like approach is used when using software rendering and the LWJGL-approach when using LWJGL. If this doesn't work, it's either a problem of LWJGL for Mac or i'm doing something not 100% right to query the keyboard. Then again, there's not much room to do things wrong...

Have you tried fullscreen mode on Mac? Maybe the keyboard will work there!?

12053
Support / Ray/polygon collision
« on: May 17, 2004, 05:08:24 pm »
You are right: The ellipsoid doesn't get transformed like the object. It always remains "axis aligned". It's on my to-do list to see, if i can do something about it. Currently, the algorithm basically works like this:

The camera/object that should be checked for a collision is transformed into the collider's (the "target" of the collision) object space. The collision detection itself is taking place in ellipsoid space, which is a scaled variant of the collider's object space in which the ellipsoid is a unit sphere.
This translation from object into ellipsoid space is the problem. It happens for a lot of vertices of the collider multiple times (depending on the recursion depth of the collision) and therefor, it has to be fast. With the "axis aligned" ellipsoid, this is easy. It requires 3 divisions/vertex. If the ellipsoid should be tranformed too, it's no longer that simple.

However, i'll look into it and see what i can do. For the time being, can't you simply use some smaller spheres placed at the car's front and back (like one left and one right) to approximate it? I'm not sure how well this will work though...

12054
Support / Using mouse in jPCT applet version
« on: May 17, 2004, 04:56:46 pm »
I see...the method doesn't get called, because the component (the applet in this case) doesn't get mouse events by default. You may either implement your own mouse listener or, if you want to use the method above, enable this type of event in your applet by calling
 
Code: [Select]
this.enableEvents(AWTEvent.MOUSE_EVENT_MASK);
somewhere in the beginning.

12055
Bugs / OS X render problems
« on: May 17, 2004, 04:43:03 pm »
I've uploaded a fixed version here: *Link removed*
It's only the API-jar, not a complete distribution. Please compile the examples from the regular distribution with this jar and tell me, if the textures are looking fine now.

Edit: The fix is now included in the release version of jPCT

12056
Support / Ray/polygon collision
« on: May 16, 2004, 05:58:43 pm »
Quote from: "Musurca"
There are still some problems when projectiles are fired at an object from close range, but I suspect the problem is that I'm spawning the projectiles inside of said object. A collision won't be registered if the ray starts inside of an object's bounding-box, right?
No, it's not a problem if it starts inside a bounding box. If it were, no projectile could collide with a large landscape if fired on the landscape's surface. The "problem" (actually it's a feature... :wink: ) is, that polygons are backface culled in respect to the position/direction of the projectile before they are checked for collision. And if you fire your shot "inside" an object, almost all polygons of your object will be culled and therefor, no collision is detected. If you really want to cover this case, i suggest to do a simple distance check between the objects or "abuse" rayIntersectsAABB(...) in Object3D somehow...

12057
Bugs / OS X render problems
« on: May 15, 2004, 12:49:03 pm »
The code of the OpenGL renderer includes a comment: "Will this work on Mac? (byte order)"...well, obviously it doesn't... :wink: Should be an easy fix in this case, albeit i'm not sure that it's the only place where little endian vs. big endian matters.
Anyway, i'll upload a version for you to test on monday.
About the input problem: I don't know. Seems to be a LWJGL problem then. You mean that you can't move around in the fps example, i assume!?

12058
Support / Ray/polygon collision
« on: May 14, 2004, 04:26:58 pm »
Does it work now?

12059
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.

12060
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.

Pages: 1 ... 802 803 [804] 805 806 ... 822