Hi,
I am still very new to JPCT-AE along with anything OGL.
I have a sphere, and I am translating the texture matrix around with touch events to make it appear as if it is moving. I am doing it this way so that I can maintain certain perspectives etc.
The problem I am having is the following. I am trying to get some sort of tapped position on my texture that I have wrapped around this sphere. I am using the following for calculating where I tapped:
final SimpleVector worldCoords = Interact2D.reproject2D3D(camera, frameBuffer, motionEventX, motionEventY);
worldCoords.matMul(camera.getBack().invert3x3());
worldCoords.add(camera.getPosition());
final SimpleVector directionFromCameraPosition = worldCoords.calcSub(camera.getPosition()).normalize();
final float distanceTo = world.calcMinDistance(worldCoords, directionFromCameraPosition, 10000);
final SimpleVector collisionPointCoords = new SimpleVector(directionFromCameraPosition);
collisionPointCoords.scalarMul(distanceTo);
collisionPointCoords.add(worldCoords);
If I add a primitive Object3d to test and I translate it to collisionPointCoords, it adds it to the world exactly where the collision point should be on my larger sphere.
How would I correlate this collision point vector to a point (xy) on my texture?
Any help would be greatly appreciated,
Thanks