Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

more work i dont remember

  • Loading branch information...
commit 3dbc462d80b330a060e84596247db5dc0b4c13f1 1 parent f6f07e2
@jeromeetienne authored
View
22 plugins/grassground/tquery.grassground.js
@@ -2,7 +2,7 @@
* Create a checkerboard tQuery.Mesh
*/
tQuery.registerStatic('createGrassGround', function(opts){
- // handle parameters
+ // handle parameters default
opts = tQuery.extend(opts, {
width : 1,
height : 1,
@@ -13,25 +13,21 @@ tQuery.registerStatic('createGrassGround', function(opts){
anisotropy : 16,
textureUrl : tQuery.createGrassGround.baseUrl + 'images/grasslight-big.jpg'
});
-
+ // create the texture
var texture = THREE.ImageUtils.loadTexture(opts.textureUrl);
texture.wrapS = THREE.RepeatWrapping;
texture.wrapT = THREE.RepeatWrapping;
texture.repeat.set(opts.textureRepeatX, opts.textureRepeatY);
texture.anisotropy = opts.anisotropy;
- var material = new THREE.MeshBasicMaterial({
- map : texture,
- color : 0x44FF44
- })
+ var object3D = tQuery.createPlane(opts.width, opts.height, opts.segmentsW, opts.segmentsH)
+ .setPhongMaterial()
+ .map(texture)
+ .color(0x44FF44)
+ .back()
+ .rotationX(-Math.PI/2)
- // create the geometry
- var geometry = new THREE.PlaneGeometry( opts.width, opts.height, opts.segmentsW, opts.segmentsH);
- // create the mesh
- var mesh = new THREE.Mesh(geometry, material);
- mesh.rotation.x = -Math.PI/2;
- // return the tQuery
- return tQuery(mesh);
+ return object3D;
});
tQuery.createGrassGround.baseUrl = "../../../plugins/grassground/";
View
6 plugins/simplemaze/tquery.simplemaze.js
@@ -81,7 +81,7 @@ tQuery.registerStatic('SimpleMaze', function(opts){
tQuery.SimpleMaze.baseUrl = "../../../plugins/simplemaze/";
-tQuery.SimpleMaze.prototype.container = function(){
+tQuery.SimpleMaze.prototype.object3D = function(){
return this._container;
}
@@ -97,7 +97,7 @@ tQuery.SimpleMaze.prototype.map = function(){
* Emulate tQuery.Object3D.addTo
*/
tQuery.SimpleMaze.prototype.addTo = function(object3D){
- this.container().addTo(object3D);
+ this.object3D().addTo(object3D);
return this;
}
@@ -105,6 +105,6 @@ tQuery.SimpleMaze.prototype.addTo = function(object3D){
* Emulate tQuery.Object3D.removeFrom
*/
tQuery.SimpleMaze.prototype.removeFrom = function(object3D){
- this.container().removeFrom(object3D);
+ this.object3D().removeFrom(object3D);
return this;
};
Please sign in to comment.
Something went wrong with that request. Please try again.