Jump to content

Spawn object over the created real world mesh (the mesh that we created from the Mixed Reality in XR Elite)


crdm21

Recommended Posts

Hello, im trying to make a simple game that need to scan our real world environment (i have done that using the Mixed Reality setup in the glasses), but when i run the ScenePerception sample project to the glasses, it looks like the raycast from the controller not detecting the real world environment that we have setup before (but we can see the created mesh visualized with the green line), how can i achieve my goal?

Link to comment
Share on other sites

Posted (edited)

you can see the screenshot here: https://ibb.co/mJRfBLt
and the video recording here: https://drive.google.com/drive/u/2/folders/1CUUktCZymTD74tl197HghqviRlQHMaIS

yes i'am referring to ScenePerceptionDemo(SceneMeshAnchor), as you can see on the video the mesh visualization can be seen, but i can't interact with it..
i'm just thinking is the mesh visualization just a visualization or is it has a collider setup within it..

if it dont have collider how do i setup it..

Edited by crdm21
adding more information
Link to comment
Share on other sites

Hi @crdm21,

There is newer version of Wave SDK available.

Feel free to update to the latest one.

And, below is the quick patch for adding MeshCollider for your need.

I modified the GeneratedSceneMeshContainer.cs file.

private GameObject GenerateNewGameObject(SceneMesh sceneMesh)
{
	//Log.d(LOG_TAG, "Add new scene mesh");
	GameObject newSceneMeshGO = ScenePerceptionObjectTools.GenerateSceneMesh(scenePerceptionManager, sceneMesh, generatedMeshMaterialWireframe, false, context.GetTrackingOrigin());

	if (newSceneMeshGO == null)
		return null;

	//Process Mesh For Wireframe rendering
	MeshFilter generatedSceneMeshFilter = newSceneMeshGO.GetComponent<MeshFilter>();
	if (generatedSceneMeshFilter && generatedSceneMeshFilter.mesh)
	{
		Mesh generatedSceneMeshInstance = generatedSceneMeshFilter.mesh;
		generatedSceneMeshFilter.mesh = ProcessSceneMeshForWireframe(generatedSceneMeshInstance);

        // Add below two lines
		var meshCollider = newSceneMeshGO.AddComponent<MeshCollider>();
		meshCollider.sharedMesh = generatedSceneMeshInstance;
	}

	return newSceneMeshGO;
}

Let me know if you have questions, thanks!

NOTE: I test and verify with Wave SDK 5.6.0-r.10.1.

  • Like 1
Link to comment
Share on other sites

okey thankyou for your solution, i will try it out..

so if the solution is to add the collider manually, that means the scene mesh that we have generate before doesn't have its collider built-in with it when we scan our room? 

Link to comment
Share on other sites

2 hours ago, VIVE_chengnay said:

Hi @crdm21,

From your screenshot, it looks like you are using 5.6.0-r.10.2?

image.png.11ebb6adba8d9a839ae1880e2e445ef4.png

Could you share the console log after you clicked "OK"? Thanks!

sorry for the confusion, i just making a new project and install the 5.6.0-r.10.1 and it works as expected, another question about the scene perception, so the scene mesh and scene planes is two different concepts, the scene mesh is for our surrounding (room), and scene plane for flat stuff like table, window, wall etc? am i right?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...