For AI agents: visit https://whsjs.readme.io/llms.txt for an index of all pages formatted in Markdown and endpoints in OpenAPI.
Jump to Content
WhitestormJS FrameworkGuidesIntegrationsBlog
GuidesIntegrationsBlog
GuidesIntegrationsBlogLog InModulesTry it on CodepenWhitestormJS Framework
Guides
Log InModulesTry it on Codepen
PerspectiveCamera

Tutorials

  • Getting Started
  • Basic sphere («Hello World» example)
  • Loops & 3D Animation
  • Groups
    • Collision filtering
  • 3D transforms
  • Usage with webpack
  • Variations
  • Modules

Core

  • App
  • Component
  • MeshComponent
  • LightComponent
  • CameraComponent
  • ModuleSystem
  • ModuleManager

Modules

  • App
    • SceneModule
    • ElementModule
    • CameraModule
    • ResizeModule
    • RenderingModule
    • PostProcessorModule
    • VirtualMouseModule
  • Controls
    • Orbit
    • First Person
  • Meshes
    • TextureModule
    • DynamicGeometryModule

Components | Meshes

  • Box
  • Cylinder
  • Dodecahedron
  • Extrude
  • Icosahedron
  • Lathe
  • Line
  • Model
  • Octahedron
  • Parametric
  • Plane
  • Polyhedron
  • Ring
  • Shape
  • Sphere
  • Tetrahedron
  • Text
  • Torus
  • Torusknot
  • Tube

Components | Lights

  • AmbientLight
  • DirectionalLight
  • HemisphereLight
  • PointLight
  • SpotLight

Components | Camera

  • PerspectiveCamera
  • OrthographicCamera
  • CubeCamera

API

  • .extend(object, ...extensions)
Powered by 

PerspectiveCamera

components / cameras / PerspectiveCamera.js

Suggest Edits

Camera with perspective projection.

const camera = new WHS.PerspectiveCamera({
  camera: {
    fov: 75,
    aspect: window.innerWidth / window.innerHeight
  },

  position: {
    x: 0,
    y: 100,
    z: 0
  }
});

world.camera = camera;

Updated less than a minute ago