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 - deqleos

Pages: [1]
Support / 3D objects offset
« on: April 12, 2018, 11:45:05 am »

I have a question regarding a weird offset I get with 3D objects.
I receive a camera preview with faces on it. I want to show 3d objects on these faces, think about masks etc.
What I do is get the position of the face on the 2d preview and translate it to the 3d space with Interact2D.reproject2D3DWS().
I get a very weird offset though, where i can't seem to get the 3d object on the position that I want it to be. For example, I have the top left coordinates of the face but the 3d object will appear significantly to the left side.

What would the ideal circumstances be for a 2dto3d translation, in terms of the z axes, 3d model itself etc.

EDIT: I'm kinda confused now how reproject2dto3dWS() works now. If i put the object at x, y=100, the object barely moves on the x axis on screen and is like halfway they axis.

EDIT2: The idea that I want to implement is very simple but I'm having a really hard time with it. See the image for a simple illustration.
I have the face's positions and just want to overlay it with a 3d model.
The code that should give me the correct world space position is:
SimpleVector simpleVector = Interact2D.reproject2D3DWS(world.getCamera(), GLFrameBuffer, (int), (int), 20);

Support / Clearing all objects upon config change
« on: April 05, 2018, 04:18:13 pm »

I'm currently creating an app where a high number of objects are created and removed during the usage.
Now I want to make sure that config changes don't create weird scenarios.
The objects that I create are dependant on the lifetime of a real world object. When the real world object isn't present anymore, the on screen object also has to be removed.
Now this works perfectly fine during the usage of the app. However, when the real world object is present and a config change occurs, the objects stay on the screen and don't get deleted. The problem lays in that the world gets deleted before the app has the chance to remove the objects.
The error i get is: 
ERROR: Can't remove object #1, because it doesn't belong to this World!

TLDR: How can I delete individual objects independent of the world they are in, instead of having to call world.removeObject();

Pages: [1]