tparisi / webglbook Goto Github PK
View Code? Open in Web Editor NEWCode Examples for Tony Parisi's Book, WebGL Up and Running
Code Examples for Tony Parisi's Book, WebGL Up and Running
Would you consider posting an explicit license on the Sim js code? Perhaps same as Three's? ie. https://github.com/mrdoob/three.js/blob/master/LICENSE
In file README.md the start command for a HTTP server should be modified:
Python 2:
python -m SimpleHTTPServer
Python 2:
python -m http.server
In the sim.js
lib at line 462-465 you have this function definition for Sim.Object
Sim.Object.prototype.update = function()
{
this.updateChildren();
}
Later in line 505 this function definition starts defining Sim.Object.prototype.update
a second time
Sim.Object.prototype.update = function()
{
var i, len;
len = this.children.length;
for (i = 0; i < len; i++)
{
this.children[i].update();
}
}
I guess the first definition gets overwritten and so the first definition simple gets ignored and so no errors derive. updateChildren()
is nowhere defined.
This could be cleaned up in a later revision.
Code examples are written to Three.js r46, as of July 2017 the current version of Three is r86.
I understand concepts are the same but code and technical examples are simply broken. Is there any plan to update?
stars.js throws error to the console "THREE.Vertex has been DEPRECATED. Use THREE.Vector3 instead."
Still haven't gotten it to show the stars...
Probably want to just change:
starsGeometry.vertices.push( new THREE.Vertex( vector ) ) ;
to:
starsGeometry.vertices.push( vector );
since vector is already a Vector3 object.
Is scene.add( camera ); necessary in example 2-1? Isn't the camera added by WebGLRenderer.render() ? That's how it's done in Example 2-2 and https://github.com/mrdoob/three.js/wiki/Getting-Started.
After updating my Sim.js with the objectIntersects() method call, I was able to get earth-lit.js to work, however, the next example, earth-shader.js, does not render properly. Using the custom ShaderMaterial(), it only renders the clouds. When I switch that chunk of code for a MeshPhongMaterial() as coded in earth-lit.js, I'm able to render the earth surface, of course without specularity and bump map. Something is wrong with the ShaderMaterial() setup.
There were some updates on three.js and SIM.js is not working properly. The main problem is comming form the intersectScene which is now replaced with intersectObjects and some slight modifications are required
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.