Skip to content

Commit 5312fa2

Browse files
committed
Vizi Update; Reordered Skybox Code for Book
1 parent e067786 commit 5312fa2

File tree

2 files changed

+10
-15
lines changed

2 files changed

+10
-15
lines changed

Chapter 11/futurgoCity.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,11 @@ FuturgoCity.prototype.addBackground = function() {
103103

104104
var envMap = THREE.ImageUtils.loadTextureCube( urls );
105105

106+
var skybox = Vizi.Prefabs.Skybox();
107+
var skyboxScript = skybox.getComponent(Vizi.SkyboxScript);
108+
skyboxScript.texture = envMap;
109+
this.viewer.addObject(skybox);
110+
106111
this.scene.map(/Tower.*|Office.*/, function(o) {
107112

108113
var visuals = o.visuals;
@@ -126,11 +131,6 @@ FuturgoCity.prototype.addBackground = function() {
126131
}
127132
});
128133

129-
var skybox = Vizi.Prefabs.Skybox(); // {texture:textureCube});
130-
var skyboxScript = skybox.getComponent(Vizi.SkyboxScript);
131-
skyboxScript.texture = envMap;
132-
this.viewer.addObject(skybox);
133-
134134
this.envMap = envMap;
135135

136136
}

libs/vizi/vizi.js

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -51819,7 +51819,6 @@ Vizi.Viewer.prototype.highlightObject = function(object) {
5181951819
wireframe:true, opacity:1})
5182051820

5182151821
var mesh = new THREE.Mesh(geo, mat);
51822-
mesh.ignorePick = true;
5182351822
this.highlightDecoration = new Vizi.Decoration({object:mesh});
5182451823
object._parent.addComponent(this.highlightDecoration);
5182551824

@@ -51899,13 +51898,6 @@ Vizi.Viewer.prototype.fitToScene = function()
5189951898

5190051899
// Bounding box display
5190151900
if (true) {
51902-
var geo = new THREE.CubeGeometry(this.boundingBox.max.x - this.boundingBox.min.x,
51903-
this.boundingBox.max.y - this.boundingBox.min.y,
51904-
this.boundingBox.max.z - this.boundingBox.min.z);
51905-
var mat = new THREE.MeshBasicMaterial({color:0x00ff00, transparent:true, wireframe:true, opacity:.2});
51906-
var mesh = new THREE.Mesh(geo, mat)
51907-
mesh.ignorePick = true;
51908-
var decoration = new Vizi.Decoration({object:mesh});
5190951901

5191051902
this.sceneRoot.map(Vizi.Object, function(o) {
5191151903
if (o._parent) {
@@ -51916,7 +51908,6 @@ Vizi.Viewer.prototype.fitToScene = function()
5191651908
bbox.max.z - bbox.min.z);
5191751909
var mat = new THREE.MeshBasicMaterial({color:0x00ff00, transparent:true, wireframe:true, opacity:.2})
5191851910
var mesh = new THREE.Mesh(geo, mat)
51919-
mesh.ignorePick = true;
5192051911
var decoration = new Vizi.Decoration({object:mesh});
5192151912
o._parent.addComponent(decoration);
5192251913

@@ -52119,7 +52110,11 @@ goog.inherits(Vizi.Decoration, Vizi.Visual);
5211952110

5212052111
Vizi.Decoration.prototype._componentCategory = "decorations";
5212152112

52122-
/**
52113+
Vizi.Decoration.prototype.realize = function()
52114+
{
52115+
Vizi.Visual.prototype.realize.call(this);
52116+
this.object.ignorePick = true;
52117+
}/**
5212352118
* @fileoverview Module Configuration
5212452119
*
5212552120
* @author Tony Parisi

0 commit comments

Comments
 (0)