Hi everyone, i'm using jpct on android since 3 days, and now i'm stuck. I wanna add some object in my world, positioning them where i click. It's probably because i really didn't understand how coords works.
I grab the 3d position with this:
SimpleVector dir=Interact2D.reproject2D3D(cam, fb, (int)xpos, (int)ypos, 10).normalize();
float distance = world.calcMinDistance(cam.getPosition(), dir, 10000);
And I clone and position the new object with this code
dir.scalarMul(distance);
objs[n] = obj.cloneObject();
objs[n].translate(dir);
world.addObject(objs[n]);
Sometimes objects appears, but at random position (but at the right height, since i click on a plane).
What am I doing wrong?
Thanks for help,
Bio
P.S. Nice work btw with the engine!