Recent Posts

Pages: 1 ... 6 7 [8] 9 10
71
Support / Re: Documentation Error
« Last post by AGP on April 20, 2018, 11:59:31 am »
I've already solved it by re-working the format. The bones thing is getting really close (except for the mysterious weights thing).
72
Support / Re: JPCT + Vuforia in stereo rendering mode
« Last post by thejauffre on April 19, 2018, 10:11:02 am »
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?
73
Support / Re: 3D objects offset
« Last post by deqleos on April 18, 2018, 11:08:07 am »
Yes that is exactly the issue, I've decided to keep the z at a fixed index and simulate object coming closer and further by scaling the 3d object. It has a decent visual experience.
Thanks a lot for helping!
74
Support / Re: 3D objects offset
« Last post by EgonOlsen on April 17, 2018, 08:24:40 pm »
Your code looks fine. It might have something to do with the depth value that you are assuming for the reprojection call....in this case 20. This implies that the "depth" of the 2D image is 20 as well, or in other words, if the 2D object would be a 3D object managed by jPCT instead, it has to have a depth of 20 to match your object's depth. If you roughly know the size of the 2D object in real world an on screen, you should be able to calculate a more or less accurate depth for your object...either that, or just guess something that looks reasonable...
75
Support / Re: 3D objects offset
« Last post by deqleos on April 17, 2018, 03:16:01 pm »
Hmm, it doesn't seem to change anything.
Don't think there is something wrong with the code I used, just to be sure:

model.build();
SimpleVector center = model.getCenter();
model.translate(-center.x, -center.y, -center.z);
model.translateMesh();
model.clearTranslation();
world.addObject(model);

I'll look a little more into the theory behind 3d. Very new to this.
I can manage to get unnoticeable offset by using a huge model and a very far z index, which is okay for now I guess.
76
Support / Re: 3D objects offset
« Last post by EgonOlsen on April 17, 2018, 12:05:59 pm »
You could do it in code as well. Just call build(), translate it by -center, call translateMesh() and clear the translation afterwards. However, this center is a calculated one. It doesn't have to be a "real" center of an object.
77
Support / Re: 3D objects offset
« Last post by deqleos on April 17, 2018, 09:58:07 am »
.getCenter() returns this: (-3.552497,1.6156462,-6.28337).
I guess your thought is then correct otherwise it would be (0,0)?
When I use a library model(primitives.getCube), .getCenter() returns (-1.4901161E-8,0.0,-1.4901161E-8). With this model the visual offset I get is a little less.
Do I manually have to manipulate the object center in different software (like Meshlab) ?
78
Support / Re: 3D objects offset
« Last post by EgonOlsen on April 16, 2018, 08:21:24 pm »
Might be that object isn't exactly centered around the orgin in object space, but I'm not sure if that would explain the increasing offset...it might, though.

What does Object3D.getCenter(); returns on your object?
79
Support / Re: 3D objects offset
« Last post by deqleos on April 16, 2018, 10:08:48 am »
Are there any other common causes? I don't have any bars on screen, just the camera preview.

EDIT: When debugging the reprojected object from 2d to 3d, I found out that projecting it back to 2d gives correct coordinates. I guess it's safe to assume the coordinates form screen match the framebuffer ones. Could my 3d model be the reason for this problem?

Edit2: See picture for what actually happens with the 3d object's position. In code I set it to be at the top left of the light grey square.
When the face moves closer, the 3d object moves more to the left of the set position, when the face moves further, the 3d objects moves more to the right of the set position.
80
Support / Re: 3D objects offset
« Last post by EgonOlsen on April 16, 2018, 07:38:19 am »
Depending on your screen setup, the coordinates in 2D on screen might not match the ones that the FrameBuffer uses. This can be caused by a bar at the top or something. Make sure that (0,0) in 2D really corresponds to (0,0) in the FB. You can simply blit something at (0,0) to the FB and see if it appears at the right position.
Pages: 1 ... 6 7 [8] 9 10