Show Posts

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.


Topics - moyosa

Pages: [1]
1
Support / Animated textures for planes...
« on: July 17, 2015, 09:08:33 am »
Hey I need some help with animated textures. I'm looking for some example code.

I dont know where to start.

Thank you so much.

2
Support / Rotate camera with current up axis
« on: January 20, 2015, 11:19:18 pm »
Here's one of my crazy examples/problems

When my camera is horizontal this works just fine.
cam.rotateCameraY((float) Math.toRadians((double) rotY));

But with my gyroscope I'm changing the camera rotation. So I probably need the current up axis.

So I've tried this. cam.rotateCameraAxis(cam.getUpVector(), (float) Math.toRadians((double) rotY));

But thats not giving me the right results...

Thanks.

3
Support / Move camera left/right on x-axis of the rotation
« on: January 15, 2015, 03:27:23 pm »
Hi,

I've got a camera and it has it's own rotation I set in the setBack. Now I want the translate let's say 10 px to the left en my camera is tilted. it does not seem to go left in the rotation x-axis but just the normal work x-axis.



So when I do a setPosition of (10,0,0). it exactly does that. But how doI translate of the rotation x-axis?



4
I'm building a 360 camera in a 3d world. Now the gyroscope is updating the camera, so it's like an AR kind of camera.

Now I want to set an offset on the x and y axis. When I start the 3d world in landscape. For example left and right is working.
But when I rotate the device to portrait, x and y should be reversed. But reproject2D3D is still giving me the same results.
So now to scroll left and right, you need to scroll up and down (makes sense?)

Seems like unproject/reproject is not working for me here.

Code: [Select]
SimpleVector startLocation = new SimpleVector(Interact2D.reproject2D3D(world.getCamera(), fb, (int)mPreviousX2, (int) mPreviousY2)).normalize();
                SimpleVector currentLocation = new SimpleVector(Interact2D.reproject2D3D(world.getCamera(), fb, (int) me.getX(), (int) me.getY())).normalize();

double alpha = Math.acos(currentLocation.y) - Math.acos(startLocation.y);
double beta = Math.atan2(currentLocation.z, currentLocation.x) - Math.atan2(startLocation.z, startLocation.x);


double tRotX = rotX - MathUtil.toDegrees((float)beta);
rotX = tRotX%360;

PS I've got this working in iOS, so should be good.

Pages: [1]