mouseEventsInvertX/Y in AndroidHarness

Hello there,



i’m playing around with the android version of jme! So far great work guys!


  1. I understand that this version of android is not a release candiate but one question raised while using a raycast on some gameobjects:

    Problem was (on my samsung galaxy nexus) that the x and y coords did not start from the lower left but from the top right due to the mouseEventsInvertX/Y fields set to true in the AndroidHarness class.

    Why is that? The raycast worked after setting the fields to false.


  2. Cause i’m not yet very experianced with 3d programming maybe someone can point me out the way to this question:

    I want my 3d objects to be placed outside the bounds of my screen and later move them into the screen bounds.

    Cause there are many different devices out there with different screen sizes:

    how would i do that to fit all screen sizes?



    thx

I will take a short at question number 2:


  • You need to know the visible space in the world coordinate. If “frustum”, “camera”, “world coordinate”, “camera coordinate” does not ring a bell for you, then you should probably grab a 3d graphic programming book :). For me personally, this book seems to be very helpful: Mobile 3D Graphics: with OpenGL ES and M3G (The Morgan Kaufmann Series in Computer Graphics) - there is one chapter describing just those terms. Anyway, the frustum is the visible space (any object outside of the frustum is outside the “boundary” of your phone). The problem then is that it is defined in the camera coordinate - you actually needs to know it in the world coordinate. If your camera would not move though, then you would generally wants to set the frustum in some easy way so that you know exactly the frustum in the world space.


  • After you know all of the above then the problem is now easy. You just initialize your object outside of the frustum, either on the left or the right of it, and then move it in gradually (like calling “move()” method on the object in onSimpleUpdate() method).

thx for reply!



well i should grab a book for 3d graphics i think!