But from where I can get the X and Y values from:
SimpleVector dir=Interact2D.reproject2D3DWS(cam, fb, x, y);
??
SimpleVector dir=Interact2D.reproject2D3DWS(cam, fb, x, y);
??
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.
Show posts Menu
public void onDrawFrame(GL10 gl) {
try {
if (!stop) {
Camera cam = world.getCamera();
SimpleVector dir=Interact2D.reproject2D3DWS(cam, fb, (int)cam.getXAxis().x, (int)cam.getXAxis().y);
dir.matMul(world.getCamera().getBack().invert3x3());
dir.add(world.getCamera().getPosition());
if (turn != 0) {
world.getCamera().rotateY(-turn);
}
if (touchTurn != 0) {
world.getCamera().rotateY(touchTurn);
touchTurn = 0;
}
if (touchTurnUp != 0) {
world.getCamera().rotateX(touchTurnUp);
touchTurnUp = 0;
}
if (move != 0) {
world.getCamera().moveCamera(cam.getDirection(), move);
}
Object[] res=world.calcMinDistanceAndObject3D(cam.getPosition(), dir, 10000 /*or whatever*/);
if(res[1]!=null)
Object3D picked=res[1]; //??????????????? I'm confuse
fb.clear(back);
world.renderScene(fb);
world.draw(fb);
blitNumber(lfps, 5, 5);
fb.display();
if (box != null) {
box.rotateX(0.01f);
}
if (sun != null) {
sun.rotate(sunRot, plane.getTransformedCenter());
}
if (System.currentTimeMillis() - time >= 1000) {
lfps = fps;
fps = 0;
time = System.currentTimeMillis();
}
fps++;
} else {
if (fb != null) {
fb.dispose();
fb = null;
}
}
} catch (Exception e) {
e.printStackTrace();
Logger.log("Drawing thread terminated!", Logger.MESSAGE);
}
Page created in 0.017 seconds with 12 queries.