Search code examples
javascriptspark-ar-studio

In SparkAR 3D custom object is not working properly as AR library 3D object on same code


I'm trying to import my custom-built 3D object from Blender in GLTB format. I applied javascript for functionality First I applied the same javascript code on 3D objects imported from the SparkAR 3D object library which gives the prebuilt object to use. The code works properly as expected on that. After that when I imported own 3D Obj and Implemented the same code on that. It stretches out the 3D object that wasn't supposed to happen. It didn't behave as previously

Result of Script on Custom Object

code that applied:

Scene Tree

First part of code

Second part of code

I don't find a mistake in it. if you can then please help!!


Solution

  • It happens if you built your 3d model in a blender in multiple parts so when you try to scale it in spark ar it will treat as multiple objects and apply scaling and transformation according to it. The problem is not with the javascript code it actually depends on 3d object so it's better you join all the object of 3d model before exporting in gLTB format. If this kind of problem is occurring to you also.

    So join all your object before importing in SparkAr it will work just fine.