Haha... Yaya... We were talking in different context... In the first reply you were saying about returning a coordinate, I took it as actual position in world space. Now I got what you mean. Thank alot for the help

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
frame = new FrameBuffer(gl, width, height);
world = new World();
world.setAmbientLight(10, 10, 10);
sun = new Light(world);
sun.setIntensity(255, 255, 255);
Texture texture = new Texture(BitmapHelper.convert(context.getResources().getDrawable(R.drawable.test3)), true);
TextureManager.getInstance().addTexture("texture", texture);
texture.setClamping(true);
plane = Primitives.getPlane(1, 0.08f);
plane.calcTextureWrapSpherical();
plane.setTexture("texture");
plane.setTransparency(0);
plane.build();
world.addObject(plane);
Camera cam = world.getCamera();
cam.moveCamera(Camera.CAMERA_MOVEOUT, 1f);
cam.lookAt(plane.getTransformedCenter());
public void onTouch(MotionEvent e) {
Camera cam = world.getCamera();
SimpleVector rayTemp = Interact2D.reproject2D3DWS(cam, frame, (int)e.getX(), (int)e.getY());
rayTemp.z = plane.getOrigin().z;
Log.v("kkl", (int)e.getX() + ", " + (int)e.getY() + ": " + rayTemp.toString());
plane.setOrigin(rayTemp);
}
public void onTouch(MotionEvent e) {
Camera cam = world.getCamera();
SimpleVector rayTemp = Interact2D.reproject2D3D(cam, frame, (int)e.getX(), (int)e.getY(), 50f);
SimpleVector camPos = cam.getPosition();
rayTemp.x += camPos.x;
rayTemp.y += camPos.y;
rayTemp.z = 0;
plane.setOrigin(rayTemp);
}
public void onTouch(MotionEvent e) {
Camera cam = world.getCamera();
SimpleVector rayTemp = Interact2D.reproject2D3D(cam, frame, (int)e.getX(), (int)e.getY(), 50f);
rayTemp.z = 0;
plane.setOrigin(rayTemp);
}
Camera cam = renderer.getWorld().getCamera();
cam.moveCamera(cam.getXAxis(), 1);
frame = new FrameBuffer(gl, width, height);
world = new World();
world.setAmbientLight(10, 10, 10);
sun = new Light(world);
sun.setIntensity(255, 255, 255);
Texture texture = new Texture(BitmapHelper.convert(context.getResources().getDrawable(R.drawable.test3)), true);
TextureManager.getInstance().addTexture("texture", texture);
texture.setClamping(true);
plane = Primitives.getPlane(20, 2);
//cube.calcTextureWrapSpherical();
plane.setTexture("texture");
plane.setTransparency(0);
plane.build();
world.addObject(plane);
Camera cam = world.getCamera();
cam.moveCamera(Camera.CAMERA_MOVEOUT, 50);
cam.lookAt(plane.getTransformedCenter());
Config.glTransparencyMul = 1f;
Config.glTransparencyOffset = 1f;
frame = new FrameBuffer(gl, width, height);
world = new World();
world.setAmbientLight(20, 20, 20);
sun = new Light(world);
sun.setIntensity(250, 250, 250);
// Create a texture out of the icon...:-)
Texture texture = new Texture(BitmapHelper.rescale(BitmapHelper.convert(context.getResources().getDrawable(R.drawable.ic_launcher)), 64, 64));
TextureManager.getInstance().addTexture("texture", texture);
texture.setClamping(true);
plane = Primitives.getPlane(3, 10);
// cube.calcTextureWrapSpherical();
plane.setTexture("texture");
plane.setTransparency(0);
plane.strip();
plane.build();
Page created in 0.030 seconds with 9 queries.