Hi, i was trying to add an scene linked to camera according to this explanation: https://developer.vuforia.com/resources/dev-guide/projection-matrix-explained
Acoording to this, i can use a modelviewmatrix setted width setIdentityM and have one object in pos 0.0.1 centered on screen and one unit away from me.
The first thing i can see, is that the modelviewmatrix setted with setIdentity * proyectionmatrix (from vuforia), give me the object 90º rotated.
So i create the modelviewmatrix with that values:
// Position the eye in front of the origin.
final float eyeX = 0.0f;
final float eyeY = 0.0f;
final float eyeZ = 0.0f;
// We are looking toward the distance
final float lookX = 0.0f;
final float lookY = 0.0f;
final float lookZ = -1.0f;
// Set our up vector. This is where our head would be pointing were we holding the camera.
final float upX = -1.0f;
final float upY = 0.0f;
final float upZ = 0.0f;
Matrix.setLookAtM(modelViewMatrix, 0, eyeX, eyeY, eyeZ, lookX, lookY, lookZ, upX, upY, upZ);
Then, i can see the object, but only if is translated in de zaxis beyond 11.0f
Can anyone explain me what happens? Or what transformation i need to do to my modelviewmatrix??
I try to change the eyeZ without success, i can only change these value from 0.0 to -1.0. If i put other value there is no render.
Thanks.
In order to find another way to get an scene on the camera position, i try to use a modelviewmatrix setted to identity, and a new proyection matrix like that:
final float ratio = (float) width / height;
final float left = -ratio;
final float right = ratio;
final float bottom = -1.0f;
final float top = 1.0f;
final float near = 1.0f;
final float far = 10.0f;
Matrix.frustumM(mProjectionMatrix, 0, left, right, bottom, top, near, far);
Thats is seted on the onSurfaceChanged function.
But when the RA inits the object is correctly rendered, but only during a while. Passed a second the object is wider than usual.
Anyone knows why its happens?
Thanks.