Software Archive
Read-only legacy content
17061 Discussions

Increasing the scene perception mesh scale in Unity3D for R200

Ashwin_S_1
Beginner
309 Views

Hi RealSense devs!

I was wondering if there was a way to increase the scale of the mesh in Unity.

I copied over the files from the RealSense demo into my project.

I was able to scale up the mesh by modifying the scale of the prefabs that are spawned in DepthFusion.cs

//DepthFusion.cs
GameObject gameObjInstance=(GameObject)Instantiate(m_meshPrefab, new Vector3(0, 0, 0), Quaternion.identity);
					gameObjInstance.transform.parent = m_meshParent.transform;
					gameObjInstance.GetComponent<DynamicMesh>().SetData(meshId, m_meshes[meshId].Key, m_meshes[meshId].Value);

//Code added to increase the scale of the instantiated mesh.
gameObjInstance.transform.localScale = gameObjInstance.transform.localScale * 10;

But I think I'm not able to get the FOV right, and I see a drift during the tracking because of that.

I was wondering if there was a better way of increasing the scale, or an easier way of finding the FOV than trial and error, that is, if the FOV is the issue.

Below is a GIF of the scaled mesh drifting, unscaled meshes work perfectly fine (when the camera is left at the default FOV of 49.04.

Thanks for your time!

- Ashwin

0 Kudos
0 Replies
Reply