Add Boat
This commit is contained in:
parent
142ae74193
commit
683440dda2
4 changed files with 1147 additions and 1 deletions
1130
assets/Cannoe.obj
Normal file
1130
assets/Cannoe.obj
Normal file
File diff suppressed because it is too large
Load diff
|
@ -1,6 +1,5 @@
|
|||
# Blender v2.76 (sub 0) OBJ File: 'house.blend'
|
||||
# www.blender.org
|
||||
mtllib house.mtl
|
||||
o Cube.028_Cube.005
|
||||
v -2.955466 1.891663 2.004628
|
||||
v -2.895956 1.895599 1.867869
|
||||
|
|
BIN
images/wood.jpg
Normal file
BIN
images/wood.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 3.4 MiB |
|
@ -69,6 +69,10 @@ function runDemo(canvasId) {
|
|||
function createObj(loader,scene){
|
||||
var stone = new BABYLON.StandardMaterial("stone", scene);
|
||||
stone.diffuseTexture = new BABYLON.Texture("images/tileable9.png", scene);
|
||||
|
||||
var wood = new BABYLON.StandardMaterial("wood", scene);
|
||||
wood.diffuseTexture = new BABYLON.Texture("images/wood.jpg", scene);
|
||||
|
||||
var house = loader.addMeshTask("house1", "", "assets/", "house.obj");
|
||||
house.onSuccess = function(t){
|
||||
t.loadedMeshes.forEach(function(m) {//m = model
|
||||
|
@ -91,6 +95,19 @@ function createObj(loader,scene){
|
|||
m.checkCollisions = true;
|
||||
});
|
||||
};
|
||||
|
||||
var boat1 = loader.addMeshTask("boat1", "", "assets/", "Cannoe.obj");
|
||||
boat1.onSuccess = function(t){
|
||||
t.loadedMeshes.forEach(function(m) {//m = model
|
||||
m.position.x = 0;
|
||||
m.position.y = -11;
|
||||
m.material = wood;
|
||||
m.position.z = 60;
|
||||
m.rotation.z = Math.PI/16;
|
||||
m.scaling = new BABYLON.Vector3(3, 3, 3);
|
||||
m.checkCollisions = true;
|
||||
});
|
||||
};
|
||||
// BABYLON.SceneLoader.ImportMesh("test", "assets/", "house.babylon", scene, function (newMeshes){
|
||||
// modele = newMeshes;
|
||||
// modele.rotation.x = 10;
|
||||
|
|
Reference in a new issue