Main Menu
Menu

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.

Show posts Menu

Messages - thejauffre

#1
I changed both. X and Y FOV are set to PI/8.5 and PI/17 respectively. However, I'm noticing that changing them does not affect the rendering - which is strange. Maybe I messed up with something, gonna check it.


Edit: Ok, changing the values of the FOVs the rendering is not stretched anymore (i put fov=1, fovY = 0.55). Still, I need to decrease fovx to a smaller value (basing on some calculations, I need it to be around 20 degrees); setting it to values lower than the unit causes the deformation, no matter the value of fovY.

Edit2: "accidentally", i found the setFOVLimits method. Well, now I can set the FOVs as I like :D
#2
Sure.
In the archive there are two screenshots (their names are self-explanatory).
I got the "correct" one by scaling the modelview matrix along the x direction, but this is like cheating (in fact, if I rotate the marker, the object will be stretched)
#3
Ok, i managed to solve part of the problem by tuning the FOV and near/far plane of JPCT camera (as i read here in the forum, applying Vuforia/OpenGL matrices is not recommended).
Now I can see the object (a square) almost on the marker, but it is stretched: it's like the horizontal side is larger than it should be.
I checked the framebuffer size, tried to change the FOV values and the planes, but nothing changed.
What could be the problem?
#4
Hi! i'm sorry to bother, but i still have some problems.
Using just the modelview matrix works fine when the video background is active. In fact, when using the smartglasses in see-through mode, Vuforia applies a projection matrix (retrieved after a per-user calibration process) to correctly display a virtual object on the scene, so that the viewer sees it on the marker, like if it was real.
So, i'm trying to use the same projection matrix on JPCT, and, by forcing it touse the same near and far planes as Vuforia, i am able to see the object right over the marker.
However, the rotations of the object are messed up: it's like I'm seeing it from an arbitrary direction, and (for example) when I rotate the marker clockwise, the object rotates counterclockwise. Maybe it is related to the different reference frame used by OpenGL and JPCT. I tried performing a rotation of the final modelviewprojection matrix (namely the product of modelview and projection mats) about 90 deg about x-axis and a negative scaling on the z-axis, but it has the same problem.
Any ideas?
#5
Ok, I found the problem: the size of the image target inside the database was not the same as I expected, so I guess it was just a problem of sizing.
Thanks :)
#6
Yes, if I use just the modelview matrix without any modification (as in the wiki) the object is displaced correctly.
#7
Well, if I use just the modelview matrix to update the camera, i don't even see the object.
If I rotate the modelview matrix of -90 degrees about x axis, I can see it, in a wrong position/rotation of course (but at least it is visible).
#8
Support / JPCT + Vuforia in stereo rendering mode
April 11, 2018, 10:15:19 AM
Hi everybody,
I'm working on a project in which I have to perform stereo rendering (using smartglasses and/or a VR viewer) using Vuforia and JPCT-AE. I am working on the DigitalEyewear example.
I followed the instructions to integrate Vuforia and JPCT in the mono rendering case, as explained in the wiki, and tried to replicate them to the stereo-rendering without success.
This is what I understood: in the mono-rendering, I just had to find the modelview matrix associated to an image target, then update the JPCT camera and start the rendering. I tried the same for the stereo case, taking into account that Vuforia has to simulate the views of the two eyes, using two virtual camera FOVs; this kinda works, but the object is not correctly displaced in the scene (i.e. I expect it to be on the origin, but it is somewhere else).
I tried to solve this problem in several ways (i.e. rotating/rescaling the modelview matrix or multiplying it by a projection matrix) but it doesn't work.
Any ideas? Thanks.
#9
Support / Re: Problem with object position
January 23, 2018, 01:32:43 PM
Ok, the problem was a rotation... In fact, rotating each object, the result appeared translated.
I solved using a Parent object, and applying the rotation only to it.
#10
Support / Problem with object position
January 23, 2018, 11:50:07 AM
Hi,
I have a problem when loading some OBJ files. I'm using JPCT-AE and Vuforia. In the same world, I have to render 2-3 objects, that I export from the same scene in 3ds max.
The problem is in the positioning: even if an object has position (0,0,0) in 3ds, when I load multiple objects in JPCT the position is not correct. The objects are somehow translated. But when I load a single object, it is in the correct position.
Am I missing something?
Thanks in advance for your help.
#11
Support / Re: Problem with rendering
January 19, 2018, 06:16:55 PM
I managed how to solve the problem.
Vuforia uses a custom shader to render the background plane, defined in their VideoBackgroundShader class.
In the vertex shader, I had just to add a translation along the z component of the gl_Position vector.
#12
Support / Re: Problem with rendering
January 19, 2018, 12:48:14 PM
I think I understood this problem: Vuforia uses a plane, rendered with OpenGLES, where it draws the camera input. My impression is that this plane "cuts" the teapot when I move the device around the target, or shows nothing when the plane is between the camera and the target.
Vuforia creates the plane by using some JNI calls, and I don't know if I can set the distance between camera and plane; i'll contact their support forum, and bring here the solution (if any).
#13
Support / Re: Problem with rendering
January 18, 2018, 04:52:07 PM
To integrate Vuforia and JPCT I followed this (http://www.jpct.net/wiki/index.php?title=Integrating_JPCT-AE_with_Vuforia).
I did some more research; apparently, Vuforia's renderer (used to render the video background) performed "GLES20.glDisable(GLES20.GL_DEPTH_TEST)" before JPCT's rendering.
Moving that glDisable command at the end of renderFrame solves the original problem.
Now I have another: the rendering of the teapot is shown only when I am close to the target, but not too close. I think it is related to the clipping planes, but if I change the values of world.setClippingPlanes or cam.setClippingPlanes there's no difference.
#14
Support / Problem with rendering
January 18, 2018, 11:42:48 AM
Hi everybody,
I'm developing an Android AR application using Vuforia (for target recognition) and JPCT-AE for the rendering of 3D objects.
I have a problem with depth sorting: when I try to render a teapot, it shows also elements that should not be present (like the handle, when I look at the teapot facing the beak).
I searched over internet, and (if I understood correctly) it is related to OpenGL and how it manages the depth rendering. However, even if I added some lines to the code (when I initialize the renderer):
GLES20.glEnable(GLES20.GL_BLEND);
        GLES20.glBlendFunc(GLES20.GL_SRC_ALPHA, GLES20.GL_ONE_MINUS_SRC_ALPHA);
        GLES20.glEnable(GLES20.GL_FRAGMENT_SHADER);
        GLES20.glEnable(GLES20.GL_DEPTH_TEST);
        GLES20.glEnable(GLES20.GL_TRUE);
        GLES20.glDepthFunc(GLES20.GL_LESS);
        GLES20.glDepthMask(GLES20.GL_TRUE);
        GLES20.glClearDepthf(1.0f);
        GLES20.glClear(GLES20.GL_COLOR_BUFFER_BIT | GLES20.GL_DEPTH_BUFFER_BIT);

it didn't change. Can you help me?
Anyway, thanks for your amazing work.