forked from mrdoob/three.js
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: add docs for the Sky object instance (mrdoob#28529)
* docs: 27034 Add docs for the Sky Object instance * add inheritance information, delete random hardcode number in example * Update Sky.html Clean up. * Update Sky.html More clean up. --------- Co-authored-by: Michael Herzog <michael.herzog@human-interactive.org>
- Loading branch information
1 parent
1603f76
commit b9a846d
Showing
2 changed files
with
93 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="utf-8" /> | ||
<base href="../../../" /> | ||
<script src="page.js"></script> | ||
<link type="text/css" rel="stylesheet" href="page.css" /> | ||
</head> | ||
<body> | ||
[page:Mesh] → | ||
|
||
<h1>[name]</h1> | ||
|
||
<p class="desc"> | ||
[name] creates a ready to go sky environment for your scenes. | ||
</p> | ||
|
||
<h2>Import</h2> | ||
|
||
<p> | ||
[name] is an add-on, and therefore must be imported explicitly. | ||
See [link:#manual/introduction/Installation Installation / Addons]. | ||
</p> | ||
|
||
<code> | ||
import { Sky } from 'three/addons/objects/Sky.js'; | ||
</code> | ||
|
||
<h2>Code Example</h2> | ||
|
||
<code> | ||
const sky = new Sky();<br /> | ||
sky.scale.setScalar( 450000 );<br /> | ||
|
||
const phi = MathUtils.degToRad( 90 );<br /> | ||
const theta = MathUtils.degToRad( 180 );<br /> | ||
const sunPosition = new Vector3().setFromSphericalCoords( 1, phi, theta );<br /> | ||
|
||
sky.material.uniforms.sunPosition.value = sunPosition;<br /> | ||
|
||
scene.add( sky ); | ||
</code> | ||
|
||
<h2>Examples</h2> | ||
|
||
<p>[example:webgl_shaders_sky misc / objects / Sky ]</p> | ||
|
||
<h2>Constructor</h2> | ||
|
||
<h3>[name]()</h3> | ||
<p> | ||
Create a new [name] instance. | ||
</p> | ||
|
||
<h2>Properties</h2> | ||
<p> | ||
[name] instance is a [page:Mesh] with a pre-defined [page:ShaderMaterial], so every property described here should be set using [page:Uniform]s. | ||
</p> | ||
|
||
<h3>[property:Number turbidity]</h3> | ||
<p> | ||
Haziness of the [name]. | ||
</p> | ||
<h3>[property:Number rayleigh]</h3> | ||
<p> | ||
For a more detailed explanation see: [link:https://en.wikipedia.org/wiki/Rayleigh_scattering Rayleigh scattering] . | ||
</p> | ||
<h3>[property:Number mieCoefficient]</h3> | ||
<p> | ||
[link:https://en.wikipedia.org/wiki/Mie_scattering Mie scattering] amount. | ||
</p> | ||
<h3>[property:Number mieDirectionalG]</h3> | ||
<p> | ||
[link:https://en.wikipedia.org/wiki/Mie_scattering Mie scattering] direction. | ||
</p> | ||
<h3>[property:Vector3 sunPosition]</h3> | ||
<p> | ||
The position of the sun. | ||
</p> | ||
<h3>[property:Vector3 up]</h3> | ||
<p> | ||
The sun's elevation from the horizon, in degrees. | ||
</p> | ||
|
||
<h2>Source</h2> | ||
|
||
<p> | ||
[link:https://github.com/mrdoob/three.js/blob/master/examples/jsm/objects/Sky.js examples/jsm/objects/Sky.js] | ||
</p> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters