mirror of
https://github.com/overte-org/overte.git
synced 2025-04-25 17:35:45 +02:00
Use existing house models
This commit is contained in:
parent
879e3054d1
commit
00f1d96af5
1 changed files with 24 additions and 9 deletions
|
@ -25,23 +25,38 @@
|
||||||
};
|
};
|
||||||
/**/
|
/**/
|
||||||
|
|
||||||
var modelUrl = "http://localhost/~stojce/models/3-Buildings-2-SanFranciscoHouse-";
|
//
|
||||||
var modelurlExt = ".fbx";
|
// var modelUrl = "http://localhost/~stojce/models/3-Buildings-2-SanFranciscoHouse-";
|
||||||
var modelVariations = 90;
|
// var modelurlExt = ".fbx";
|
||||||
|
// var modelVariations = 100;
|
||||||
|
|
||||||
|
var houseModels = [
|
||||||
|
"http://public.highfidelity.io/models/entities/3-Buildings-2-SanFranciscoHouseBlue.fbx",
|
||||||
|
"http://public.highfidelity.io/models/entities/3-Buildings-2-SanFranciscoHouseBlue3.fbx",
|
||||||
|
"http://public.highfidelity.io/models/entities/3-Buildings-2-SanFranciscoHouseGreen.fbx",
|
||||||
|
"http://public.highfidelity.io/models/entities/3-Buildings-2-SanFranciscoHouseGreen2.fbx",
|
||||||
|
"http://public.highfidelity.io/models/entities/3-Buildings-2-SanFranciscoHouseRed.fbx",
|
||||||
|
"http://public.highfidelity.io/models/entities/3-Buildings-2-SanFranciscoHouseRose.fbx",
|
||||||
|
"http://public.highfidelity.io/models/entities/3-Buildings-2-SanFranciscoHouseViolet.fbx",
|
||||||
|
"http://public.highfidelity.io/models/entities/3-Buildings-2-SanFranciscoHouseYellow.fbx",
|
||||||
|
"http://public.highfidelity.io/models/entities/3-Buildings-2-SanFranciscoHouseYellow2.fbx"
|
||||||
|
];
|
||||||
|
|
||||||
var houses = [];
|
var houses = [];
|
||||||
|
|
||||||
function addHouseAt(position, rotation) {
|
function addHouseAt(position, rotation) {
|
||||||
// get random house model
|
// get random house model
|
||||||
var modelNumber = 1 + Math.floor(Math.random() * (modelVariations - 1));
|
//var modelNumber = 1 + Math.floor(Math.random() * (modelVariations - 1));
|
||||||
var modUrl = modelUrl + modelNumber + modelurlExt;
|
//var modelUrl = modelUrl + modelNumber + modelurlExt;
|
||||||
print("Model ID:" + modelNumber);
|
//print("Model ID:" + modelNumber);
|
||||||
|
var modelUrl = houseModels[Math.floor(Math.random() * houseModels.length)];
|
||||||
|
|
||||||
var properties = {
|
var properties = {
|
||||||
type: "Model",
|
type: "Model",
|
||||||
position: position,
|
position: position,
|
||||||
rotation: rotation,
|
rotation: rotation,
|
||||||
dimensions: sizeOfTheHouse,
|
dimensions: sizeOfTheHouse,
|
||||||
modelURL: modUrl
|
modelURL: modelUrl
|
||||||
};
|
};
|
||||||
|
|
||||||
return Entities.addEntity(properties);
|
return Entities.addEntity(properties);
|
||||||
|
@ -77,7 +92,7 @@
|
||||||
z: dd
|
z: dd
|
||||||
};
|
};
|
||||||
|
|
||||||
print("House nr.:" + houses.length + 1);
|
print("House nr.:" + (houses.length + 1));
|
||||||
houses.push(
|
houses.push(
|
||||||
addHouseAt(Vec3.sum(housePos, posShift), (j % 2 == 0) ? rotEven : rotOdd)
|
addHouseAt(Vec3.sum(housePos, posShift), (j % 2 == 0) ? rotEven : rotOdd)
|
||||||
);
|
);
|
||||||
|
|
Loading…
Reference in a new issue