[docs] TorusKnotGeometry & TorusKnotBufferGeometry misleading code in the official docs
See original GitHub issueDescription of the problem
The official docs for TorusKnotGeometry and TorusKnotBufferGeometry has misleading code examples. To achieve that one as in the docs developers need to use MeshLambertMaterial
, not MeshBasicMaterial
as written in the docs. It gives completely different output than in the code examples which you can see in the CodeSandboxes below.
If you’ll take a look into the color 0xffff00
in code examples, it cannot match, because it’s yellow. Not like in the visualisation light blue…
It looks like these docs should be improved to give a real code, because based on these I couldn’t reproduce the effect, at all. Possibly it would be MeshLambertMaterial
with AmbientLight
/PointLight
(or any other lights - couldn’t fully reproduce on my own). For other settings of this visualisation I’ve followed creating a scene manual.
- CodeSandbox using MeshLambertMaterial based on official code example
- CodeSandbox using MeshBasicMaterial based on official code example
Three.js version
- 110 (latest at CDN)
Browser
- All of them
OS
- Not applicable
Hardware Requirements (graphics card, VR Device, …)
- None
Issue Analytics
- State:
- Created 3 years ago
- Comments:9
Top GitHub Comments
@Mugen87 many thanks!
Didn’t catch this, just used parameters from the official docs.
Here is the updated live example. The parameters of
TorusKnotBufferGeometry
were slightly off:https://codesandbox.io/s/torusknotbuffergeometry-almost-complete-as-in-the-official-docs-4qgci?file=/index.html
I was referring to the minimal code example, not the geometry browser.