Skip to content

Commit

Permalink
Add meterials to side of wheels.
Browse files Browse the repository at this point in the history
  • Loading branch information
YorkshireKev committed Aug 31, 2015
1 parent 281c6bd commit feabfbf
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 49 deletions.
Binary file modified assets/wheel.blend
Binary file not shown.
Binary file modified assets/wheel.blend1
Binary file not shown.
24 changes: 9 additions & 15 deletions js/slotmachine.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,29 +104,24 @@ function virtualSlotMachine() {

//Load Wheel
var wheels = [];
var wheelTexture, wheelMaterial, loader;
wheelTexture = THREE.ImageUtils.loadTexture("images/wheel.png");
wheelTexture.minFilter = THREE.NearestFilter;
wheelMaterial = new THREE.MeshPhongMaterial({
ambient: 0x999999,
color: 0xffffff,
specular: 0x333333,
shininess: 8,
shading: THREE.SmoothShading,
map: wheelTexture
});
var loader;

//Texture loaded from wheel.json file vial loaded routine below.
/*var wheelMaterial = new THREE.MeshPhongMaterial({
map: THREE.ImageUtils.loadTexture('images/wheel.png')
});*/

// instantiate a loader
loader = new THREE.JSONLoader();
// load a resource
loader.load(
// resource URL
'js/wheel.js',
'js/wheel.json',
// Function when resource is loaded
function (geometry) {
function (geometry, materials) {
var ix = 0;
for (ix = 0; ix < 3; ix += 1) {
wheels[ix] = new THREE.Mesh(geometry, wheelMaterial);
wheels[ix] = new THREE.Mesh(geometry, new THREE.MeshFaceMaterial(materials));
wheels[ix].scale.x = 10;
wheels[ix].scale.y = 10;
wheels[ix].scale.z = 10;
Expand Down Expand Up @@ -303,7 +298,6 @@ function virtualSlotMachine() {
camera.aspect = window.innerWidth / window.innerHeight;
camera.updateProjectionMatrix();
renderer.setSize(window.innerWidth, window.innerHeight);
console.log("resize!");
}
window.addEventListener('resize', onResize, false);

Expand Down
16 changes: 0 additions & 16 deletions js/wheel.js

This file was deleted.

Loading

0 comments on commit feabfbf

Please sign in to comment.