Skip to content

Instantly share code, notes, and snippets.

@flushpot1125
Last active August 15, 2018 03:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save flushpot1125/4083d91ca1585b8cf01dbd78d65a69cc to your computer and use it in GitHub Desktop.
Save flushpot1125/4083d91ca1585b8cf01dbd78d65a69cc to your computer and use it in GitHub Desktop.
//マテリアルの宣言
var myBrickImageMaterial = new BABYLON.StandardMaterial("brick", scene);
//マテリアルの中にあるテクスチャプロパティに、テクスチャを設定
myBrickImageMaterial.ambientTexture = new BABYLON.Texture("textures filepath", scene);
//オブジェクトのマテリアルプロパティと、先ほど宣言したマテリアルを対応づけ
box1.material = myBrickImageMaterial;
box2.material = myBrickImageMaterial;
box3.material = myBrickImageMaterial;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment