packtpublishing / learn-three.js-fourth-edition Goto Github PK
View Code? Open in Web Editor NEWLearn Three.js, Fourth edition, published by Packt
License: MIT License
Learn Three.js, Fourth edition, published by Packt
License: MIT License
ran npm i
and then npm run serve
from http://localhost:8080/. Seeing Cannot GET /
`Learn-Three.js-Fourth-edition/source
▶ npm run serve
> [email protected] serve
> webpack serve --open
<i> [webpack-dev-server] Project is running at:
<i> [webpack-dev-server] Loopback: http://localhost:8080/
<i> [webpack-dev-server] On Your Network (IPv4): http://192.168.1.104:8080/
<i> [webpack-dev-server] On Your Network (IPv6): http://[fe80::1]:8080/
<i> [webpack-dev-server] Content not from webpack is served from '/Users/stanwiechers/devedge/Learn-Three.js-Fourth-edition/source/assets, /Users/stanwiechers/devedge/Learn-Three.js-Fourth-edition/source/dist' directory
<i> [webpack-dev-middleware] wait until bundle finished: /
391 assets
runtime modules 4.81 MiB 2224 modules
orphan modules 251 bytes [orphan] 4 modules
cacheable modules 5.77 MiB (javascript) 1.29 MiB (webassembly)
modules by path ./samples/ 398 KiB
modules by path ./samples/chapters/ 346 KiB 191 modules
modules by path ./samples/controls/*.js 30.9 KiB 11 modules
modules by path ./samples/util/*.js 3.08 KiB 8 modules
modules by path ./samples/*.js 9.08 KiB 4 modules
modules by path ./samples/bootstrap/*.js 2.97 KiB 3 modules
+ 3 modules
modules by path ./node_modules/ 5.38 MiB (javascript) 1.29 MiB (webassembly) 191 modules
webpack 5.70.0 compiled successfully in 2004 ms
Modifying the file source/samples/chapters/chapter-1/geometries.js
and using npm run build/watch
will not take effect.
In ch-02, third topic: The basic functionality of a scene, it states "In the source code for this chapter, you can find the chapter-2/basic- scene.html example. "
However, there are no html pages in the src folder, only js files. is this a misprint or are supposed to create the html ourselves?
Not sure how common this is, but seems like you changed your naming convention at some point while writing the book and old references are still in place.
For example, on page 13 it says:
However, the source isn't organized that way: https://github.com/PacktPublishing/Learn-Three.js-Fourth-edition/blob/main/source/samples/chapters/chapter-1/geometries.js
There is no leading zero.
Note that this screenshot highlights two times where this occurs, but there's a third one a few lines above the highlighted section. It's also on other pages (perhaps many pages, though I haven't read that far yet).
BTW, if I should not report errata here, let me know and I'll adjust accordingly going forward.
I'm not really sure what to make of this:
In the snippet above, you are adding the spotlight target to the scene rather than to the spotlight itself. In the paragraph following that, you then talk about adding the spotlight target to the scene, and then you repeat the same line of code, as if to imply you're adding something new to the above code snippet (despite it being the same thing).
This page does provide some illumination: https://threejs.org/docs/#api/en/lights/SpotLight
It first shows adding the spotlight to the scene:
scene.add( spotLight );
And then later has a section about the target in which it adds the spotlight target to the scene:
scene.add( light.target );
Which it explains is only necessary if you want to change the target.
Perhaps you meant to first add the spotlight, and then to subsequently also add the spotlight target?
Here is page 39:
These methods are mentioned with the initial letter uppercased, yet their actual implementation is lowercased: attach, remove, clear.
As an aside, the description of the attach function is confusing to me. You state that it differs from add() in that rotations/translations are retained. However, the example from the prior page shows that you add (rather than attach) the cube with a position and rotation. This makes me wonder if your description is correct (or perhaps it meant to say something slightly different than what I'm interpreting it to mean).
EDIT: Also noticed similar on page 74 with "Angle" and "Color".
Here is what page 38 says:
The highlighted text mentions that the name attribute is set on the cube, yet you can see in the above example the name attribute is not set.
OTOH, the online source code indeed shows the name being set: https://github.com/PacktPublishing/Learn-Three.js-Fourth-edition/blob/main/source/samples/controls/add-remove-cube-controls.js#L46
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.