Hey, me again, still doing modifications on that project. Hit a snatch though, whenever I compile an object Interact2d code will give problems (I need to compile the objects to use shaders btw)
For example, following code will still work:
//naar 3d coordinaten
SimpleVector position = new SimpleVector(Interact2D.reproject2D3D(
camera, buffer, x, y));
//naar world space coordinaten
position.matMul(camera.getBack().invert3x3());
position.add(camera.getPosition());
SimpleVector direction = position.calcSub(camera.getPosition()).normalize();
float distance = world.calcMinDistance(position, direction, 10000);
SimpleVector collisionPoint = new SimpleVector(direction);
collisionPoint.scalarMul(distance);
collisionPoint.add(position);
if ((e.getModifiers() & InputEvent.BUTTON1_MASK) == InputEvent.BUTTON1_MASK)
{
if(distance != Object3D.COLLISION_NONE)
{
It will report a collision, however, when I request the ID of the polygon that has been hit the result is null
position = new SimpleVector(Interact2D.reproject2D3D(
camera, buffer, x, y));
int[] is = Interact2D.pickPolygon(world.getVisibilityList(), position, Interact2D.EXCLUDE_NOT_SELECTABLE);
int t = Interact2D.getObjectID(is);
Any idea what is going wrong?