Home › Forums › Bug Reports and Feature Requests › improper display of objects containing group dependencies in Android AR
- This topic has 17 replies, 3 voices, and was last updated 2 years, 8 months ago by precismo.
-
AuthorPosts
-
2020-11-04 at 6:50 am #34979precismoCustomer
Hi Verge3D,
this will be a bit longer as I will try to describe error in detail.
When working with 3D models in Blender, we found out that having parent dependencies is causing improper object placement in Android AR.
This scene in Blender (exported via verge3D export to gltf):
[image:blender-error.JPG]Is properly displayed in viewer (looks like Blender scene).
But (only) in Android AR, after placement, is such that part of object is improperly transformed:
[image:bad-ar.png]Please notice that this “head object” which is improperly placed is exactly this object with child dependency in Blender scene.
When we apply following “fix” select child object – object->parent->Clear and keep transformation:
[image:fixing.png]After export, problem is suddenly solved:
[good-ar.jpg]Being able to hotfix is nice but our graphics would like to keep dependencies as this helps them work with scenes properly.
This applies to all Verge3D versions as far as I know.
—
We are using following code in visual_logic.js inspired by your AR example (object_group is group of objects from Blender)registerOnClick(['GROUP', 'indicator_group'], function() { changeVis(['GROUP', 'object_group'], true); setObjTransform(['GROUP', 'object_group'], 'position', arHitPoint('x'), arHitPoint('y'), arHitPoint('z'), false); setObjDirection(['GROUP', 'object_group'], getObjTransform('Camera', 'position', 'x'), getObjTransform('Camera', 'position', 'y'), getObjTransform('Camera', 'position', 'z'), true); }, function() {});
which is calling your function function
setObjDirection(objNames, x, y, z, lockUp)
for AR objects initial positioning.Solution:
I think this could be fixed by following:
– our graphics team constantly removing all parent dependencies before export (manual time consuming, undesirable, human error)
– modification of your python export Blender script Verge3D GLTF for automatic removal of such parent dependencies
– improving mentioned javascript function for proper initial object placement in Android AR scenePlease let me know if you needed anything else.
Thank you very much in advance for your support!
Petr Sehnal, Precismo
Attachments:
You must be logged in to view attached files.2020-11-04 at 6:51 am #34984precismoCustomeradding attachements (original post limit is 4)
Attachments:
You must be logged in to view attached files.2020-11-04 at 9:49 am #35017Alexander KovelenovStaffHi,
This might happen due to additional object called v3d_Proxy_Node_N_ParentedName. This object is inserted between parented object and object’s parent to keep the initial transformation of the former.
I believe you need to figure out how you will define your object center. E.g if you’ll do it at the parent object than you should place your parent directly (not group). If you’re going to place your child, then you better unparent it and reset transformation (with parent to <none> object and set transform to zeroes).2020-11-04 at 12:51 pm #35031precismoCustomerThank you for your input.
We found out that GLTF Verge3D export does not contain scale and rotation attribute for AR-misplaced objects. Manual addition of those attributes to GLTF source fixes the problem. We will investigate further and provide additional details.
2020-11-04 at 1:46 pm #35043precismoCustomer2Alexandr:
– Tried setObjDirection in visual_logic.js – does work, but only in viewer. AR seems to ignore it completely.
– Tried parenting object using makeParent, unfortunately without luck as well :(Any more ideas, please?
2020-11-09 at 10:34 am #35154Alexander KovelenovStaffHi,
Camera direction should work in AR mode. Please check the Augmented Reality demo in you Verge3D distribution. See below how it is done there:
For parenting issue what I meant acutally is to peform unparenting of your 3D objects. To do so you should specify <none> in the make parent puzzle.
Attachments:
You must be logged in to view attached files.2020-11-10 at 8:56 am #35179precismoCustomerThank you!
It seems it is something in the scene or export. I have tried to do minimal demo containing scene which is displayed differently in viewer and AR – please see attached screenshots and scene.
Please can you help me identify, what exactly is causing first cube to look differently in AR? I cant seem to find it.
Thanks very much for your support! It will help us debug project for our customer.
Attachments:
You must be logged in to view attached files.2020-11-10 at 1:59 pm #35197precismoCustomerI found out that function setObjDirection is for some reason executed only for one object which is causing this error. Internally It uses same retrieveObjectNames for getting list of objects as setObjTransform and Im calling them equivalently with same object parameters in my visual_logic.js which i copied from your AR example:
setObjTransform([‘GROUP’, ‘object_group’], ‘position’, arHitPoint(‘x’), arHitPoint(‘y’), arHitPoint(‘z’), false);setObjDirection([‘GROUP’, ‘object_group’], getObjTransform(‘Camera’, ‘position’, ‘x’), getObjTransform(‘Camera’, ‘position’, ‘y’), getObjTransform(‘Camera’, ‘position’, ‘z’), true);
Please can you help me identify, why is this happening?
2020-11-10 at 2:21 pm #35199Alexander KovelenovStaff2020-11-11 at 6:41 am #35217precismoCustomerGreat, thank you! :)
2020-11-12 at 6:53 am #35246precismoCustomerKindly please if you can also fix hierarchical positioning – AR rotation is also different from viewer when they are object parents/children in Blender.
Thank you very much in advance!
2020-11-12 at 9:44 am #35261Alexander KovelenovStaff2020-11-19 at 9:19 am #35525Yuri KovelenovStaff2021-02-04 at 10:31 am #38058precismoCustomerThanks a lot Yuri!
Your fix worked for all models with single-group hiearachy. Howerver if we add second level grouping (i.e. group inside group)*, error is again there. Attaching sample screenshots and model.
*Unfortunately it is the only way how to currently created linked/composite objects in Blender as far as we know. The other option is to creatre single object composite but this is problem for materials and movement.
Please would it be possible to fix also this two-level grouping?
much appreciated,
Petr from Precismo
Attachments:
You must be logged in to view attached files.2021-03-24 at 8:22 am #39736precismoCustomerAny update on this, please?
-
AuthorPosts
- You must be logged in to reply to this topic.