MrPowerShell

Examples

Three.js Examples

This page clones the three.js examples

View Source

$greatGreatGrandParent = $PSScriptRoot | Split-Path | Split-Path | Split-Path
$threeJsPath = $greatGreatGrandParent | Join-Path -ChildPath 'three.js'

$3jsFiles = 
    git.sparse -Repository https://github.com/mrdoob/three.js/ -Pattern "/examples/**/**.html" -Path $threeJsPath

$htmlFiles = $3jsFiles | 
    Where-Object Extension -eq '.html'
    
$pageDepth = 0
$inSegments = @()
$root = "$pwd"

"<h2>Three.js Examples</h2>"

"<p>This page clones the <a href='https://github.com/mrdoob/three.js'>three.js</a> examples</p>"

"<details>"
"<summary>View Source</summary>"
"<pre><code class='language-PowerShell'>$([Web.HttpUtility]::HtmlEncode($MyInvocation.MyCommand.ScriptBlock))</code></pre>"
"</details>"
"<hr/>"
foreach ($file in $htmlFiles) {
    if ($file.Name -eq 'index.html') { continue }
    $fileSegments = @($file.Name -split '[/_]')
    $parentSegments = $fileSegments[0..($fileSegments.Count - 2)]
           
    if ("$parentSegments" -ne "$inSegments") {
        if ($inSegments) {
            "</ul>"
            "</details>"
        }
        $inSegments = $parentSegments
        "<details open>"
        "<summary>$($parentSegments -join ' / ')</summary>"
        "<ul>"
    }
    "<li>"
    $exampleFileName = $file.Name -replace '\.html$'
    "<a href='https://threejs.org/examples/#$exampleFileName'>$($exampleFileName)</a>"
    "</li>"
}

css2d
css3d
games
misc / animation
misc
misc / controls
misc / exporter
misc / raycaster
misc / uv
physics / ammo
physics / jolt
physics / rapier
physics / rapier / character
physics / rapier
physics / rapier / vehicle
svg
webaudio
webgl / animation
webgl / animation / skinning / additive
webgl / animation / skinning
webgl / animation
webgl / batch / lod
webgl / buffergeometry / attributes
webgl / buffergeometry / custom / attributes
webgl / buffergeometry
webgl / buffergeometry / instancing
webgl / buffergeometry
webgl / buffergeometry / lines
webgl / buffergeometry
webgl / buffergeometry / points
webgl / buffergeometry
webgl / buffergeometry / selective
webgl / buffergeometry
webgl
webgl / camera
webgl
webgl / clipping
webgl
webgl / custom / attributes
webgl / custom
webgl
webgl / depth
webgl / effects
webgl / framebuffer
webgl / furnace
webgl
webgl / geometry / colors
webgl / geometry
webgl / geometry / extrude
webgl / geometry
webgl / geometry / spline
webgl / geometry
webgl / geometry / terrain
webgl / geometry
webgl / geometry / text
webgl / geometry
webgl / gpgpu / birds
webgl / gpgpu
webgl
webgl / instancing
webgl / interactive
webgl / interactive / cubes
webgl / interactive
webgl / interactive / raycasting
webgl / interactive
webgl
webgl / lightprobe
webgl
webgl / lights
webgl / lines
webgl / lines / fat
webgl / lines
webgl / loader
webgl / loader / 3mf
webgl / loader
webgl / loader / collada
webgl / loader
webgl / loader / fbx
webgl / loader
webgl / loader / gltf / animation
webgl / loader / gltf
webgl / loader / gltf / progressive
webgl / loader / gltf
webgl / loader
webgl / loader / md2
webgl / loader
webgl / loader / texture
webgl / loader
webgl
webgl / materials
webgl / materials / blending
webgl / materials
webgl / materials / cubemap
webgl / materials / cubemap / render / to
webgl / materials
webgl / materials / envmaps
webgl / materials
webgl / materials / normalmap / object
webgl / materials
webgl / materials / physical
webgl / materials / physical / transmission
webgl / materials / physical
webgl / materials / subsurface
webgl / materials / texture
webgl / materials
webgl / materials / video
webgl / materials
webgl / math
webgl / math / orientation
webgl / mesh
webgl
webgl / modifier / curve
webgl / modifier
webgl / morphtargets
webgl
webgl / multiple / elements
webgl / multiple
webgl / multiple / scenes
webgl / multiple
webgl / multisampled
webgl / panorama
webgl
webgl / pmrem
webgl / points
webgl
webgl / postprocessing
webgl / postprocessing / material
webgl / postprocessing
webgl / postprocessing / rgb
webgl / postprocessing
webgl / postprocessing / unreal / bloom
webgl / postprocessing / unreal
webgl
webgl / random
webgl / raycaster
webgl / read / float
webgl
webgl / renderer
webgl / rendertarget
webgl / reversed / depth
webgl
webgl / shader
webgl
webgl / shaders
webgl / shadow
webgl / shadowmap
webgl
webgl / simple
webgl
webgl / test
webgl / test / wide
webgl / texture2darray
webgl
webgl / texture3d
webgl
webgl / ubo
webgl
webgl / video
webgl / video / panorama
webgl / volume
webgl
webgl / worker
webgpu / animation / retargeting
webgpu / animation
webgpu / backdrop
webgpu
webgpu / camera
webgpu
webgpu / centroid
webgpu
webgpu / compute
webgpu / compute / particles
webgpu / compute
webgpu / compute / sort
webgpu / compute / texture
webgpu / compute
webgpu / cubemap
webgpu / custom / fog
webgpu / custom
webgpu / depth
webgpu / display
webgpu
webgpu / instance
webgpu / instancing
webgpu
webgpu / lightprobe
webgpu
webgpu / lights
webgpu / lights / ies
webgpu / lights
webgpu / lines / fat
webgpu / lines
webgpu / loader / gltf
webgpu / loader
webgpu / loader / texture
webgpu / materials
webgpu / materials / cubemap
webgpu / materials
webgpu / materials / envmaps
webgpu / materials
webgpu / materials / texture
webgpu / materials
webgpu
webgpu / materialx
webgpu / mesh
webgpu
webgpu / modifier
webgpu / morphtargets
webgpu
webgpu / mrt
webgpu
webgpu / multiple
webgpu / multiple / rendertargets
webgpu / multiple
webgpu / multisampled
webgpu
webgpu / parallax
webgpu
webgpu / performance
webgpu
webgpu / pmrem
webgpu
webgpu / postprocessing
webgpu / postprocessing / bloom
webgpu / postprocessing
webgpu / postprocessing / dof
webgpu / postprocessing
webgpu / postprocessing / motion
webgpu / postprocessing
webgpu / postprocessing / radial
webgpu / postprocessing
webgpu
webgpu / procedural
webgpu / reflection
webgpu
webgpu / rendertarget / 2d-array
webgpu
webgpu / shadow
webgpu / shadowmap
webgpu
webgpu / skinning
webgpu
webgpu / storage
webgpu / struct
webgpu / test
webgpu
webgpu / textures / 2d-array
webgpu / textures
webgpu
webgpu / tsl / angular
webgpu / tsl / compute / attractors
webgpu / tsl
webgpu / tsl / procedural
webgpu / tsl / raging
webgpu / tsl
webgpu / tsl / vfx
webgpu / tsl
webgpu / video
webgpu / volume
webgpu / volume / lighting
webgpu / volume
webgpu
webgpu / xr
webgpu / xr / native
webgpu / xr
webxr / ar / camera
webxr / ar
webxr / ar / plane
webxr / vr / handinput
webxr / vr
webxr / vr / panorama
webxr / vr
webxr / xr
webxr / xr / controls
webxr / xr
webxr / xr / dragging / custom
webxr / xr