|
From: <ma...@us...> - 2011-12-13 15:35:10
|
Revision: 575
http://openautomation.svn.sourceforge.net/openautomation/?rev=575&view=rev
Author: mayerch
Date: 2011-12-13 15:35:00 +0000 (Tue, 13 Dec 2011)
Log Message:
-----------
Added inital support for textures
Modified Paths:
--------------
JSFloorPlan/trunk/jsfloorplan.js
JSFloorPlan/trunk/jsfloorplan_example_helper.js
Added Paths:
-----------
JSFloorPlan/trunk/media/
JSFloorPlan/trunk/media/demo_texture_512x512.png
Modified: JSFloorPlan/trunk/jsfloorplan.js
===================================================================
--- JSFloorPlan/trunk/jsfloorplan.js 2011-12-13 12:43:52 UTC (rev 574)
+++ JSFloorPlan/trunk/jsfloorplan.js 2011-12-13 15:35:00 UTC (rev 575)
@@ -315,9 +315,13 @@
{
// Add the wall sides
geometry.faces.push(new THREE.Face3( 2, 3, 0 ));
+ geometry.faceVertexUvs[0].push([ new THREE.UV(1,1), new THREE.UV(1,0), new THREE.UV(0,1) ]);
geometry.faces.push(new THREE.Face3( 1, 0, 3 ));
+ geometry.faceVertexUvs[0].push([ new THREE.UV(0,0), new THREE.UV(0,1), new THREE.UV(1,0) ]);
geometry.faces.push(new THREE.Face3( 5, 6, 7 ));
+ geometry.faceVertexUvs[0].push([ new THREE.UV(1,1), new THREE.UV(1,0), new THREE.UV(0,1) ]);
geometry.faces.push(new THREE.Face3( 8, 7, 6 ));
+ geometry.faceVertexUvs[0].push([ new THREE.UV(0,0), new THREE.UV(0,1), new THREE.UV(1,0) ]);
// Add the wall tops
geometry.faces.push(new THREE.Face3( 1, 6, 9 ));
geometry.faces.push(new THREE.Face3( 6, 1, 3 ));
@@ -326,9 +330,13 @@
} else {
// Add the wall sides
geometry.faces.push(new THREE.Face3( 2, 0, 3 ));
+ geometry.faceVertexUvs[0].push([ new THREE.UV(0,1), new THREE.UV(1,1), new THREE.UV(0,0) ]);
geometry.faces.push(new THREE.Face3( 1, 3, 0 ));
+ geometry.faceVertexUvs[0].push([ new THREE.UV(1,0), new THREE.UV(0,0), new THREE.UV(1,1) ]);
geometry.faces.push(new THREE.Face3( 5, 7, 6 ));
+ geometry.faceVertexUvs[0].push([ new THREE.UV(0,1), new THREE.UV(1,1), new THREE.UV(0,0) ]);
geometry.faces.push(new THREE.Face3( 8, 6, 7 ));
+ geometry.faceVertexUvs[0].push([ new THREE.UV(1,0), new THREE.UV(0,0), new THREE.UV(1,1) ]);
// Add the wall tops
geometry.faces.push(new THREE.Face3( 1, 9, 6 ));
geometry.faces.push(new THREE.Face3( 6, 3, 1 ));
Modified: JSFloorPlan/trunk/jsfloorplan_example_helper.js
===================================================================
--- JSFloorPlan/trunk/jsfloorplan_example_helper.js 2011-12-13 12:43:52 UTC (rev 574)
+++ JSFloorPlan/trunk/jsfloorplan_example_helper.js 2011-12-13 15:35:00 UTC (rev 575)
@@ -113,6 +113,8 @@
cube.position = new THREE.Vector3(50,50,50);
//scene.add( cube );
+cubeMaterial = new THREE.MeshBasicMaterial({ map: THREE.ImageUtils.loadTexture( 'media/demo_texture_512x512.png' ) });
+
var lineMaterial = new THREE.LineBasicMaterial( { color: 0x0099ff, linewidth: 2 } );
// create a point light
Added: JSFloorPlan/trunk/media/demo_texture_512x512.png
===================================================================
(Binary files differ)
Property changes on: JSFloorPlan/trunk/media/demo_texture_512x512.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|