Permalink
Browse files

more work

  • Loading branch information...
1 parent 8b8f1c1 commit b01c1a34f102f7162b8592a4397c77887d297e7d @jeromeetienne committed Feb 27, 2013
@@ -38949,7 +38949,7 @@ tQuery.registerStatic('createTorus', function(){
tQuery.registerStatic('createTorusKnot', function(){
var ctor = THREE.TorusKnotGeometry;
- var dflGeometry = [0.5-0.15, 0.15, 128, 32];
+ var dflGeometry = [0.27, 0.1, 128, 32];
return this._createMesh(ctor, dflGeometry, arguments)
});
View
@@ -38949,7 +38949,7 @@ tQuery.registerStatic('createTorus', function(){
tQuery.registerStatic('createTorusKnot', function(){
var ctor = THREE.TorusKnotGeometry;
- var dflGeometry = [0.5-0.15, 0.15, 128, 32];
+ var dflGeometry = [0.27, 0.1, 128, 32];
return this._createMesh(ctor, dflGeometry, arguments)
});
View
@@ -1723,7 +1723,7 @@ tQuery.registerStatic('createTorus', function(){
tQuery.registerStatic('createTorusKnot', function(){
var ctor = THREE.TorusKnotGeometry;
- var dflGeometry = [0.5-0.15, 0.15, 128, 32];
+ var dflGeometry = [0.27, 0.1, 128, 32];
return this._createMesh(ctor, dflGeometry, arguments)
});
View
@@ -105,7 +105,7 @@ tQuery.registerStatic('createTorus', function(){
tQuery.registerStatic('createTorusKnot', function(){
var ctor = THREE.TorusKnotGeometry;
- var dflGeometry = [0.5-0.15, 0.15, 128, 32];
+ var dflGeometry = [0.27, 0.1, 128, 32];
return this._createMesh(ctor, dflGeometry, arguments)
});
@@ -21,7 +21,7 @@ tQuery.registerStatic('createGrassGround', function(opts){
texture.anisotropy = opts.anisotropy;
var object3D = tQuery.createPlane(opts.width, opts.height, opts.segmentsW, opts.segmentsH)
- .setPhongMaterial()
+ .setBasicMaterial()
.map(texture)
.color(0x44FF44)
.back()
@@ -7,6 +7,7 @@
var world = tQuery.createWorld().boilerplate().start();
var object3d = tQuery.createTorus().addTo(world);
+ // at every frame
world.loop().hook(function(){
if( tQuery.keyboard().pressed('a') ){
object3d.scale(2);
@@ -15,6 +16,7 @@
}
})
+ // only on keydown
var keyboard = tQuery.keyboard();
keyboard.domElement().addEventListener('keydown', function(){
if( keyboard.pressed('left') ) object3d.rotateX( Math.PI/6)
@@ -8,6 +8,7 @@
, 'tquery.keyboard'
, 'tquery.fog'
, 'tquery.controls'
+ , 'tquery.pproc'
], function(){
var world = tQuery.createWorld().boilerplate().start();
@@ -22,6 +23,15 @@
tQuery.Pacman.create('eyes').addTo(world)
.translateZ(-3)
+ world.addEffectComposer()
+ .bloom(0.2)
+ //.sepia()
+ .motionBlur(0.5)
+ //.film(0.2, 0.5, 648, false)
+ .vignette()
+ //.screen()
+ .finish();
+
world.tRenderer().setClearColorHex( 0x000000, 1 );
// put some lights
@@ -47,7 +57,7 @@
//world.addFogExp2({density: 0.1});
// add a skymap
-// tQuery.createSkymap('skybox').addTo(world);
+ //tQuery.createSkymap('skybox').addTo(world);
@@ -1,29 +1,40 @@
<!doctype html><title>Minimal tQuery Page</title>
<script src="../../../build/tquery-bundle-require.js"></script>
<body><script>
+require(['tquery.skymap', 'tquery.grassground', 'tquery.minecraft'], function(){
var world = tQuery.createWorld().boilerplate().start();
- tQuery.createSphere().addTo(world)
- .scale(1000)
- .setBasicMaterial()
- .map('images/2294472375_24a3b8ef46_o.jpg')
- .side(THREE.BackSide)
- .back()
+ tQuery.createSkymap('mars').addTo(world);
+
+ tQuery.createGrassGround({
+ textureRepeatX : 10,
+ textureRepeatY : 10,
+ }).addTo(world).scale(30)
+ .translateY(-0.001)
+
+
var cubeCamera = new THREE.CubeCamera( 0.001, 1000, 256 );
// to avoid flickering on the border of the sphere
cubeCamera.renderTarget.minFilter = THREE.LinearMipMapLinearFilter;
- var tMaterial = new THREE.MeshBasicMaterial({
- envMap : cubeCamera.renderTarget
- });
+ var sphere = tQuery.createSphere().addTo(world).translateY(0.8)
+ .setBasicMaterial({
+ envMap : cubeCamera.renderTarget
+ })
+ .color(0xffff00)
+ .back()
- var sphere = tQuery.createSphere(tMaterial).addTo(world)
- tQuery(cubeCamera).addTo(sphere)
+ // var sphere = tQuery.createPlane().addTo(world)
+ // .setBasicMaterial({
+ // envMap : cubeCamera.renderTarget
+ // }).back()
+ // .scaleBy(10)
+ // .positionY(5)
+ // .positionZ(-3)
- tQuery.createSphere().addTo(world)
- .positionX( 1)
+ tQuery(cubeCamera).addTo(sphere)
world.loop().hook(function(){
sphere.visible(false) // *cough*
@@ -32,4 +43,25 @@
sphere.visible(true) // *cough*
})
+
+ world.loop().hook(function(delta, now){
+ var angle = 0.2 * now * Math.PI * 2;
+ sphere.positionY(Math.sin(angle)*0.5 + 0.6)
+ .scale(Math.sin(angle)*0.3 + 1)
+ })
+
+ var character = tQuery.createMinecraftChar().addTo(world)
+ character.object3D().translateX(-0.7)
+ .rotateY(Math.PI/3)
+
+ var character = tQuery.createMinecraftChar().addTo(world)
+ character.object3D().translateX(+0.7)
+ .rotateY(-Math.PI/3)
+
+ var character = tQuery.createMinecraftChar().addTo(world)
+ character.object3D()
+ .rotateY(Math.PI)
+ .translateX(0.4)
+ .translateZ(+1)
+})
</script></body>

0 comments on commit b01c1a3

Please sign in to comment.