Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
/* Create material */
const material = new SceneExampleMaterial(this._context, 'ExampleMaterial1');
material.texture = texture;
material.textured = true;
/* Create geometry. */
const geometry = new GeosphereGeometry(
this._context,
'mesh',
1.0,
true);
geometry.initialize(this._aMeshVertex, this._aMeshTexCoord);
const sphere = new GeometryComponent();
sphere.geometry = geometry;
sphere.material = material;
node.addComponent(sphere);
return node;
}
const scale = mat4.fromScaling(mat4.create(), vec3.fromValues(0.5, 0.5, 0.5));
const transformMatrix = mat4.multiply(mat4.create(), translate, scale);
const transform = new TransformComponent(transformMatrix);
node.addComponent(transform);
/* Create material */
const material = new SceneExampleMaterial(this._context, 'ExampleMaterial3');
material.textured = false;
/* Create geometry. */
const geometry = new CuboidGeometry(this._context, 'mesh', true);
geometry.initialize(this._aMeshVertex, this._aMeshTexCoord);
const box = new GeometryComponent();
box.geometry = geometry;
box.material = material;
node.addComponent(box);
return node;
}
}
node.addComponent(transform);
/* Create material */
const material = new SceneExampleMaterial(this._context, 'ExampleMaterial2');
material.textured = false;
/* Create geometry. */
const geometry = new GeosphereGeometry(
this._context,
'mesh',
1.0,
true);
geometry.initialize(this._aMeshVertex, this._aMeshTexCoord);
const sphere = new GeometryComponent();
sphere.geometry = geometry;
sphere.material = material;
node.addComponent(sphere);
return node;
}
const scale = mat4.fromScaling(mat4.create(), vec3.fromValues(0.5, 0.5, 0.5));
const transformMatrix = mat4.multiply(mat4.create(), translate, scale);
const transform = new TransformComponent(transformMatrix);
node.addComponent(transform);
/* Create material */
const material = new SceneExampleMaterial(this._context, 'ExampleMaterial3');
material.textured = false;
/* Create geometry. */
const geometry = new CuboidGeometry(this._context, 'mesh', true);
geometry.initialize(this._aMeshVertex, this._aMeshTexCoord);
const box = new GeometryComponent();
box.geometry = geometry;
box.material = material;
node.addComponent(box);
return node;
}
}
/* Create material */
const material = new SceneExampleMaterial(this._context, 'ExampleMaterial1');
material.texture = texture;
material.textured = true;
/* Create geometry. */
const geometry = new GeosphereGeometry(
this._context,
'mesh',
1.0,
true);
geometry.initialize(this._aMeshVertex, this._aMeshTexCoord);
const sphere = new GeometryComponent();
sphere.geometry = geometry;
sphere.material = material;
node.addComponent(sphere);
return node;
}
node.addComponent(transform);
/* Create material */
const material = new SceneExampleMaterial(this._context, 'ExampleMaterial2');
material.textured = false;
/* Create geometry. */
const geometry = new GeosphereGeometry(
this._context,
'mesh',
1.0,
true);
geometry.initialize(this._aMeshVertex, this._aMeshTexCoord);
const sphere = new GeometryComponent();
sphere.geometry = geometry;
sphere.material = material;
node.addComponent(sphere);
return node;
}