Jump to content

How to use the same mesh for different objects in space ?


GrosSacASacs
 Share

Recommended Posts

How can I use the same mesh for 2 different object in the 3D space ?

What I tried:

    //...
        //before the mesh is loaded we use another mesh
        hero = BABYLON.Mesh.CreateSphere("sphere1", 16, 0.1, scene);
        enemy = BABYLON.Mesh.CreateSphere("sphere2", 16, 0.1, scene);

        BABYLON.SceneLoader.ImportMesh("fr", "/", "models/5.babylon", scene,
            function (newMeshes, particleSystems) {
                camera.target = newMeshes[0];
                hero = newMeshes[0];
                enemy = newMeshes[0]
                //how can I separate hero and enemy again ?
            }
        );
   //...

If there are different ways to do , give me the one that uses the least resources.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...