Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
28bf66496b
1 changed files with 75 additions and 0 deletions
|
@ -102,6 +102,32 @@ function createObj(loader,scene){
|
||||||
f2.position = new BABYLON.Vector3(-10, 0.0, -5);
|
f2.position = new BABYLON.Vector3(-10, 0.0, -5);
|
||||||
createParticle(f2,scene);
|
createParticle(f2,scene);
|
||||||
|
|
||||||
|
var house3 = loader.addMeshTask("house2", "", "assets/", "house.obj");
|
||||||
|
house3.onSuccess = function(t){
|
||||||
|
t.loadedMeshes.forEach(function(m) {//m = model
|
||||||
|
m.position.x = 10;
|
||||||
|
m.position.y = -5;
|
||||||
|
m.material = stone;
|
||||||
|
m.position.z = 130;
|
||||||
|
m.position.x = 10;
|
||||||
|
m.scaling = new BABYLON.Vector3(3, 3, 3);
|
||||||
|
m.checkCollisions = true;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
var house3 = loader.addMeshTask("house2", "", "assets/", "house.obj");
|
||||||
|
house3.onSuccess = function(t){
|
||||||
|
t.loadedMeshes.forEach(function(m) {//m = model
|
||||||
|
m.position.x = 10;
|
||||||
|
m.position.y = -5;
|
||||||
|
m.material = stone;
|
||||||
|
m.position.z = 150;
|
||||||
|
m.position.x = -10;
|
||||||
|
m.scaling = new BABYLON.Vector3(3, 3, 3);
|
||||||
|
m.checkCollisions = true;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
var boat1 = loader.addMeshTask("boat1", "", "assets/", "Cannoe.obj");
|
var boat1 = loader.addMeshTask("boat1", "", "assets/", "Cannoe.obj");
|
||||||
boat1.onSuccess = function(t){
|
boat1.onSuccess = function(t){
|
||||||
t.loadedMeshes.forEach(function(m) {//m = model
|
t.loadedMeshes.forEach(function(m) {//m = model
|
||||||
|
@ -114,6 +140,21 @@ function createObj(loader,scene){
|
||||||
m.checkCollisions = true;
|
m.checkCollisions = true;
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
var boat2 = loader.addMeshTask("boat1", "", "assets/", "Cannoe.obj");
|
||||||
|
boat2.onSuccess = function(t){
|
||||||
|
t.loadedMeshes.forEach(function(m) {//m = model
|
||||||
|
m.position.x = 0;
|
||||||
|
m.position.y = -11;
|
||||||
|
m.position.x = -10;
|
||||||
|
m.material = wood;
|
||||||
|
m.position.z = 80;
|
||||||
|
m.rotation.z = Math.PI/16;
|
||||||
|
m.rotation.y = Math.PI / 2;
|
||||||
|
m.scaling = new BABYLON.Vector3(3, 3, 3);
|
||||||
|
m.checkCollisions = true;
|
||||||
|
});
|
||||||
|
};
|
||||||
// BABYLON.SceneLoader.ImportMesh("test", "assets/", "house.babylon", scene, function (newMeshes){
|
// BABYLON.SceneLoader.ImportMesh("test", "assets/", "house.babylon", scene, function (newMeshes){
|
||||||
// modele = newMeshes;
|
// modele = newMeshes;
|
||||||
// modele.rotation.x = 10;
|
// modele.rotation.x = 10;
|
||||||
|
@ -468,4 +509,38 @@ function createDemoScene(scene) {
|
||||||
mur4Salle3.material = wall;
|
mur4Salle3.material = wall;
|
||||||
mur4Salle3.checkCollisions = true;
|
mur4Salle3.checkCollisions = true;
|
||||||
|
|
||||||
|
|
||||||
|
var box = new BABYLON.Mesh.CreateBox("crate", 2, scene);
|
||||||
|
box.material = new BABYLON.StandardMaterial("Mat", scene);
|
||||||
|
box.material.diffuseTexture = new BABYLON.Texture("images/box.png", scene);
|
||||||
|
box.position = new BABYLON.Vector3(20, 1, 140);
|
||||||
|
|
||||||
|
var box2 = new BABYLON.Mesh.CreateBox("crate", 2, scene);
|
||||||
|
box2.material = new BABYLON.StandardMaterial("Mat", scene);
|
||||||
|
box2.material.diffuseTexture = new BABYLON.Texture("images/box.png", scene);
|
||||||
|
box2.material.diffuseTexture.hasAlpha = true;
|
||||||
|
box2.position = new BABYLON.Vector3(10, 1, 140);
|
||||||
|
|
||||||
|
var box3 = new BABYLON.Mesh.CreateBox("crate", 2, scene);
|
||||||
|
box3.material = new BABYLON.StandardMaterial("Mat", scene);
|
||||||
|
box3.material.diffuseTexture = new BABYLON.Texture("images/box.png", scene);
|
||||||
|
box3.material.diffuseTexture.hasAlpha = true;
|
||||||
|
box3.position = new BABYLON.Vector3(20, 1, 130);
|
||||||
|
|
||||||
|
var box4 = new BABYLON.Mesh.CreateBox("crate", 2, scene);
|
||||||
|
box4.material = new BABYLON.StandardMaterial("Mat", scene);
|
||||||
|
box4.material.diffuseTexture = new BABYLON.Texture("images/box.png", scene);
|
||||||
|
box4.material.diffuseTexture.hasAlpha = true;
|
||||||
|
box4.position = new BABYLON.Vector3(-20, 1, 130);
|
||||||
|
|
||||||
|
var box5 = new BABYLON.Mesh.CreateBox("crate", 2, scene);
|
||||||
|
box5.material = new BABYLON.StandardMaterial("Mat", scene);
|
||||||
|
box5.material.diffuseTexture = new BABYLON.Texture("images/box.png", scene);
|
||||||
|
box5.material.diffuseTexture.hasAlpha = true;
|
||||||
|
box5.position = new BABYLON.Vector3(-30, 1, 150);
|
||||||
|
|
||||||
|
var box6 = new BABYLON.Mesh.CreateBox("crate", 2, scene);
|
||||||
|
box6.material = new BABYLON.StandardMaterial("Mat", scene);
|
||||||
|
box6.material.diffuseTexture = new BABYLON.Texture("images/box.png", scene);
|
||||||
|
box6.position = new BABYLON.Vector3(0, 1, 120);
|
||||||
}
|
}
|
||||||
|
|
Reference in a new issue