Jump to content

How to clone texture


mattx264
 Share

Recommended Posts

  BABYLON.SceneLoader.ImportMesh("", "../Content/flag3d/", "untitled.babylon", scene, function (newMeshes, particleSystems) {

                for (var i = 0; i < newMeshes.length; i++) {

              

                    if (newMeshes.name == "plakietka2" || newMeshes.name == "gwozdz") {

                        var obj;

                        var positionY = newMeshes.position.y;

                        for (var j = 0; j < 10; j++) {

                            obj = newMeshes.clone("c" + j);

                           positionY -= 50

                           var backgroundTexture = new BABYLON.DynamicTexture("dynamic texture", 512, scene, true);

                           backgroundTexture.drawText("Eternalcoding"+j , null, 80, "bold 50px Segoe UI", "white", "#555555");//set different name

                            obj.position = new BABYLON.Vector3(0, positionY, 0);

                            obj.material.diffuseTexture = backgroundTexture;

                obj.material.specularColor = new BABYLON.Color3(0, 0, 0);

                obj.material.backFaceCulling = false;

                        }

             }

}

Link to comment
Share on other sites

My question is how to clone texture.

var cloneTexture = backgroundTexture.clone("dynamic texture clone");

 

I don't know why it doesn't show up

BABYLON.SceneLoader.ImportMesh("plakietka2", "../Content/flag3d/", "untitled.babylon", scene, function (newMeshes, particleSystems)

 

The name must match the name in the mesh of babylon file

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...