OK. Thanks. Maybe you know alternative 3d engines to do that?
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 MenuSimpleVector limit_vector = new SimpleVector(0,1,0);
float angle = limit_vector.calcAngle(camera.getYAxis());
if(angle+Math.abs(movement.worldRotationX)<1.56f){
camera.rotateX(-movement.worldRotationX);
camera.rotateY(-movement.cameraRotationY);
} else {
camera.rotateY(-movement.cameraRotationY/10);
}
private void moveCamera() {
Movement movement = _movementhandler.getMovement();
Object3D MyObject = one_layer.get(0);
if (movement.hasMovement()) {
Camera camera = world.getCamera();
if(camera_z-movement.cameraMovementZ>10 && camera_z-movement.cameraMovementZ<200)
camera_z-=movement.cameraMovementZ;
camera.rotateX(-movement.worldRotationX);
camera.rotateY(-movement.cameraRotationY);
camera.setPosition(MyObject.getTransformedCenter());
camera.moveCamera(Camera.CAMERA_MOVEOUT, camera_z);
camera.lookAt(MyObject.getTransformedCenter());
}
private void moveCamera() {
Movement movement = _movementhandler.getMovement();
SimpleVector cam_pos = new SimpleVector();
Object3D MyObject = one_layer.get(one_layer.size()/2);
if (movement.hasMovement()) {
Camera camera = world.getCamera();
camera.getPosition(cam_pos);
camera_z-=movement.cameraMovementZ;//variable to add distance to object
camera.rotateX(-movement.worldRotationX);
movement.worldRotationX = 0.0f;
camera.rotateY(-movement.cameraRotationY);
movement.cameraRotationY = 0.0f;
camera.setPosition(MyObject.getTransformedCenter());
camera.moveCamera(Camera.CAMERA_MOVEOUT, camera_z);
camera.moveCamera(Camera.CAMERA_MOVEIN, movement.cameraMovementZ);
}
}
public void onDrawFrame(GL10 gl) {
if (!stop) {
fb.clear(back);
mSkybox.render(world,fb);
world.renderScene(fb);
world.draw(fb);
moveCamera();
fb.display();
} else {
if (fb != null) {
fb.dispose();
fb = null;
}
}
}
private void moveCamera() {
Movement movement = _movementhandler.getMovement();
SimpleVector cam_pos = new SimpleVector();
Object3D MyObject = one_layer.get(one_layer.size()/2);
if (movement.hasMovement()) {
Camera camera = world.getCamera();
camera.getPosition(cam_pos);
SimpleVector backVect = MyObject.getTransformedCenter();
backVect.scalarMul(-1.0f);
Matrix rotationmatrix = new Matrix();
rotationmatrix.translate(backVect);
rotationmatrix.rotateY(movement.cameraRotationY);
rotationmatrix.translate(MyObject.getTransformedCenter());
cam_pos.matMul(rotationmatrix);
camera.setPosition(cam_pos);
camera.lookAt(one_layer.get(one_layer.size()/2).getTransformedCenter());
camera.moveCamera(Camera.CAMERA_MOVEUP, movement.worldRotationX*10);
camera.moveCamera(Camera.CAMERA_MOVEIN, movement.cameraMovementZ);
}
}
Page created in 0.021 seconds with 12 queries.