Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 4 additions & 0 deletions examples/css2d_label.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
<meta property="og:title" content="three.js css2d - label">
<meta property="og:type" content="website">
<meta property="og:url" content="https://threejs.org/examples/css2d_label.html">
<meta property="og:image" content="https://threejs.org/examples/screenshots/css2d_label.jpg">
<title>three.js css2d - label</title>
<link type="text/css" rel="stylesheet" href="main.css">
<style>
Expand Down
4 changes: 4 additions & 0 deletions examples/css3d_mixed.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
<title>three.js css3d - mixed</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
<meta property="og:title" content="three.js css3d - mixed">
<meta property="og:type" content="website">
<meta property="og:url" content="https://threejs.org/examples/css3d_mixed.html">
<meta property="og:image" content="https://threejs.org/examples/screenshots/css3d_mixed.jpg">
<link type="text/css" rel="stylesheet" href="main.css">
<style>
body {
Expand Down
4 changes: 4 additions & 0 deletions examples/css3d_molecules.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
<title>three.js css3d - molecules</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
<meta property="og:title" content="three.js css3d - molecules">
<meta property="og:type" content="website">
<meta property="og:url" content="https://threejs.org/examples/css3d_molecules.html">
<meta property="og:image" content="https://threejs.org/examples/screenshots/css3d_molecules.jpg">
<link type="text/css" rel="stylesheet" href="main.css">
<style>
body {
Expand Down
4 changes: 4 additions & 0 deletions examples/css3d_orthographic.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
<title>three.js css3d - orthographic</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
<meta property="og:title" content="three.js css3d - orthographic">
<meta property="og:type" content="website">
<meta property="og:url" content="https://threejs.org/examples/css3d_orthographic.html">
<meta property="og:image" content="https://threejs.org/examples/screenshots/css3d_orthographic.jpg">
<link type="text/css" rel="stylesheet" href="main.css">
<style>
body {
Expand Down
4 changes: 4 additions & 0 deletions examples/css3d_periodictable.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
<title>three.js css3d - periodic table</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
<meta property="og:title" content="three.js css3d - periodic table">
<meta property="og:type" content="website">
<meta property="og:url" content="https://threejs.org/examples/css3d_periodictable.html">
<meta property="og:image" content="https://threejs.org/examples/screenshots/css3d_periodictable.jpg">
<link type="text/css" rel="stylesheet" href="main.css">
<style>
a {
Expand Down
5 changes: 5 additions & 0 deletions examples/css3d_sandbox.html
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
<!DOCTYPE html>
<html>
<head>
<title>three.js css3d - sandbox</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
<meta property="og:title" content="three.js css3d - sandbox">
<meta property="og:type" content="website">
<meta property="og:url" content="https://threejs.org/examples/css3d_sandbox.html">
<meta property="og:image" content="https://threejs.org/examples/screenshots/css3d_sandbox.jpg">
<link type="text/css" rel="stylesheet" href="main.css">
<style>
body {
Expand Down
4 changes: 4 additions & 0 deletions examples/css3d_sprites.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
<title>three.js css3d - sprites</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
<meta property="og:title" content="three.js css3d - sprites">
<meta property="og:type" content="website">
<meta property="og:url" content="https://threejs.org/examples/css3d_sprites.html">
<meta property="og:image" content="https://threejs.org/examples/screenshots/css3d_sprites.jpg">
<link type="text/css" rel="stylesheet" href="main.css">
<style>
body {
Expand Down
4 changes: 4 additions & 0 deletions examples/css3d_youtube.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
<title>three.js css3d - youtube</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
<meta property="og:title" content="three.js css3d - youtube">
<meta property="og:type" content="website">
<meta property="og:url" content="https://threejs.org/examples/css3d_youtube.html">
<meta property="og:image" content="https://threejs.org/examples/screenshots/css3d_youtube.jpg">
<link type="text/css" rel="stylesheet" href="main.css">
<style>
body {
Expand Down
4 changes: 4 additions & 0 deletions examples/games_fps.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
<title>three.js - misc - octree collisions</title>
<meta charset=utf-8 />
<meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
<meta property="og:title" content="three.js - misc - octree collisions">
<meta property="og:type" content="website">
<meta property="og:url" content="https://threejs.org/examples/games_fps.html">
<meta property="og:image" content="https://threejs.org/examples/screenshots/games_fps.jpg">
<link type="text/css" rel="stylesheet" href="main.css">
</head>
<body>
Expand Down
4 changes: 4 additions & 0 deletions examples/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
<meta charset="utf-8">
<title>three.js examples</title>
<meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
<meta property="og:title" content="three.js examples">
<meta property="og:type" content="website">
<meta property="og:url" content="https://threejs.org/examples/index.html">
<meta property="og:image" content="https://threejs.org/files/og_image.jpg">
<link rel="shortcut icon" href="../files/favicon_white.ico" media="(prefers-color-scheme: dark)"/>
<link rel="shortcut icon" href="../files/favicon.ico" media="(prefers-color-scheme: light)" />
<link rel="stylesheet" type="text/css" href="../files/main.css">
Expand Down
27 changes: 14 additions & 13 deletions examples/jsm/controls/TransformControls.js
Original file line number Diff line number Diff line change
Expand Up @@ -578,35 +578,27 @@ class TransformControls extends Controls {

if ( space === 'world' ) {

if ( object.parent ) {

object.position.add( _tempVector.setFromMatrixPosition( object.parent.matrixWorld ) );

}
object.getWorldPosition( _tempVector );

if ( axis.search( 'X' ) !== - 1 ) {

object.position.x = Math.round( object.position.x / this.translationSnap ) * this.translationSnap;
_tempVector.x = Math.round( _tempVector.x / this.translationSnap ) * this.translationSnap;

}

if ( axis.search( 'Y' ) !== - 1 ) {

object.position.y = Math.round( object.position.y / this.translationSnap ) * this.translationSnap;
_tempVector.y = Math.round( _tempVector.y / this.translationSnap ) * this.translationSnap;

}

if ( axis.search( 'Z' ) !== - 1 ) {

object.position.z = Math.round( object.position.z / this.translationSnap ) * this.translationSnap;
_tempVector.z = Math.round( _tempVector.z / this.translationSnap ) * this.translationSnap;

}

if ( object.parent ) {

object.position.sub( _tempVector.setFromMatrixPosition( object.parent.matrixWorld ) );

}
object.position.copy( object.parent.worldToLocal( _tempVector ) );

}

Expand Down Expand Up @@ -1150,6 +1142,15 @@ class TransformControlsRoot extends Object3D {

}

// Cancel out the parent's transform so the gizmo stays world-aligned.

if ( this.parent ) {

_tempMatrix.copy( this.parent.matrixWorld ).invert();
_tempMatrix.decompose( this.position, this.quaternion, this.scale );

}

super.updateMatrixWorld( force );

}
Expand Down
4 changes: 4 additions & 0 deletions examples/misc_animation_groups.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
<title>three.js webgl - animation - groups</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
<meta property="og:title" content="three.js webgl - animation - groups">
<meta property="og:type" content="website">
<meta property="og:url" content="https://threejs.org/examples/misc_animation_groups.html">
<meta property="og:image" content="https://threejs.org/examples/screenshots/misc_animation_groups.jpg">
<link type="text/css" rel="stylesheet" href="main.css">
</head>
<body>
Expand Down
4 changes: 4 additions & 0 deletions examples/misc_animation_keys.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
<title>three.js webgl - animation - basic</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
<meta property="og:title" content="three.js webgl - animation - basic">
<meta property="og:type" content="website">
<meta property="og:url" content="https://threejs.org/examples/misc_animation_keys.html">
<meta property="og:image" content="https://threejs.org/examples/screenshots/misc_animation_keys.jpg">
<link type="text/css" rel="stylesheet" href="main.css">
</head>
<body>
Expand Down
4 changes: 4 additions & 0 deletions examples/misc_boxselection.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
<title>three.js webgl - box selection</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
<meta property="og:title" content="three.js webgl - box selection">
<meta property="og:type" content="website">
<meta property="og:url" content="https://threejs.org/examples/misc_boxselection.html">
<meta property="og:image" content="https://threejs.org/examples/screenshots/misc_boxselection.jpg">
<link type="text/css" rel="stylesheet" href="main.css">
<style>
body {
Expand Down
4 changes: 4 additions & 0 deletions examples/misc_controls_arcball.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
<title>three.js webgl - arcball controls</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
<meta property="og:title" content="three.js webgl - arcball controls">
<meta property="og:type" content="website">
<meta property="og:url" content="https://threejs.org/examples/misc_controls_arcball.html">
<meta property="og:image" content="https://threejs.org/examples/screenshots/misc_controls_arcball.jpg">
<link type="text/css" rel="stylesheet" href="main.css">

</head>
Expand Down
4 changes: 4 additions & 0 deletions examples/misc_controls_drag.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
<title>three.js webgl - drag controls</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
<meta property="og:title" content="three.js webgl - drag controls">
<meta property="og:type" content="website">
<meta property="og:url" content="https://threejs.org/examples/misc_controls_drag.html">
<meta property="og:image" content="https://threejs.org/examples/screenshots/misc_controls_drag.jpg">
<link type="text/css" rel="stylesheet" href="main.css">
<style>
body {
Expand Down
4 changes: 4 additions & 0 deletions examples/misc_controls_fly.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
<title>three.js webgpu - fly controls - earth</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
<meta property="og:title" content="three.js webgpu - fly controls - earth">
<meta property="og:type" content="website">
<meta property="og:url" content="https://threejs.org/examples/misc_controls_fly.html">
<meta property="og:image" content="https://threejs.org/examples/screenshots/misc_controls_fly.jpg">
<link type="text/css" rel="stylesheet" href="main.css">
<style>
body {
Expand Down
4 changes: 4 additions & 0 deletions examples/misc_controls_map.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
<title>three.js webgl - map controls</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
<meta property="og:title" content="three.js webgl - map controls">
<meta property="og:type" content="website">
<meta property="og:url" content="https://threejs.org/examples/misc_controls_map.html">
<meta property="og:image" content="https://threejs.org/examples/screenshots/misc_controls_map.jpg">
<link type="text/css" rel="stylesheet" href="main.css">
<style>
body {
Expand Down
4 changes: 4 additions & 0 deletions examples/misc_controls_orbit.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
<title>three.js webgl - orbit controls</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
<meta property="og:title" content="three.js webgl - orbit controls">
<meta property="og:type" content="website">
<meta property="og:url" content="https://threejs.org/examples/misc_controls_orbit.html">
<meta property="og:image" content="https://threejs.org/examples/screenshots/misc_controls_orbit.jpg">
<link type="text/css" rel="stylesheet" href="main.css">
<style>
body {
Expand Down
4 changes: 4 additions & 0 deletions examples/misc_controls_pointerlock.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
<title>three.js - pointerlock controls</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
<meta property="og:title" content="three.js - pointerlock controls">
<meta property="og:type" content="website">
<meta property="og:url" content="https://threejs.org/examples/misc_controls_pointerlock.html">
<meta property="og:image" content="https://threejs.org/examples/screenshots/misc_controls_pointerlock.jpg">
<link type="text/css" rel="stylesheet" href="main.css">
<style>
#blocker {
Expand Down
4 changes: 4 additions & 0 deletions examples/misc_controls_trackball.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
<title>three.js webgl - trackball controls</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
<meta property="og:title" content="three.js webgl - trackball controls">
<meta property="og:type" content="website">
<meta property="og:url" content="https://threejs.org/examples/misc_controls_trackball.html">
<meta property="og:image" content="https://threejs.org/examples/screenshots/misc_controls_trackball.jpg">
<link type="text/css" rel="stylesheet" href="main.css">
<style>
body {
Expand Down
6 changes: 5 additions & 1 deletion examples/misc_controls_transform.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,17 @@
<title>three.js webgl - transform controls</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
<meta property="og:title" content="three.js webgl - transform controls">
<meta property="og:type" content="website">
<meta property="og:url" content="https://threejs.org/examples/misc_controls_transform.html">
<meta property="og:image" content="https://threejs.org/examples/screenshots/misc_controls_transform.jpg">
<link type="text/css" rel="stylesheet" href="main.css">
</head>
<body>

<div id="info">
"W" translate | "E" rotate | "R" scale | "+/-" adjust size<br />
"Q" toggle world/local space | "Shift" snap to grid<br />
"Q" toggle world/local space | "Shift" hold to snap to grid<br />
"X" toggle X | "Y" toggle Y | "Z" toggle Z | "Spacebar" toggle enabled<br />
"Esc" reset current transform<br />
"C" toggle camera | "V" random zoom
Expand Down
4 changes: 4 additions & 0 deletions examples/misc_exporter_draco.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
<title>three.js webgl - exporter - draco</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
<meta property="og:title" content="three.js webgl - exporter - draco">
<meta property="og:type" content="website">
<meta property="og:url" content="https://threejs.org/examples/misc_exporter_draco.html">
<meta property="og:image" content="https://threejs.org/examples/screenshots/misc_exporter_draco.jpg">
<link type="text/css" rel="stylesheet" href="main.css">
</head>
<body>
Expand Down
4 changes: 4 additions & 0 deletions examples/misc_exporter_exr.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
<title>three.js webgl - exporter - exr</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
<meta property="og:title" content="three.js webgl - exporter - exr">
<meta property="og:type" content="website">
<meta property="og:url" content="https://threejs.org/examples/misc_exporter_exr.html">
<meta property="og:image" content="https://threejs.org/examples/screenshots/misc_exporter_exr.jpg">
<link type="text/css" rel="stylesheet" href="main.css">
</head>
<body>
Expand Down
4 changes: 4 additions & 0 deletions examples/misc_exporter_gcode.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
<title>three.js webgl - exporter - GCode</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
<meta property="og:title" content="three.js webgl - exporter - GCode">
<meta property="og:type" content="website">
<meta property="og:url" content="https://threejs.org/examples/misc_exporter_gcode.html">
<meta property="og:image" content="https://threejs.org/examples/screenshots/misc_exporter_gcode.jpg">
<link type="text/css" rel="stylesheet" href="main.css">
</head>
<body>
Expand Down
4 changes: 4 additions & 0 deletions examples/misc_exporter_gltf.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
<title>three.js webgl - exporter - gltf</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
<meta property="og:title" content="three.js webgl - exporter - gltf">
<meta property="og:type" content="website">
<meta property="og:url" content="https://threejs.org/examples/misc_exporter_gltf.html">
<meta property="og:image" content="https://threejs.org/examples/screenshots/misc_exporter_gltf.jpg">
<link type="text/css" rel="stylesheet" href="main.css">
</head>
<body>
Expand Down
4 changes: 4 additions & 0 deletions examples/misc_exporter_ktx2.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
<title>three.js webgl - exporter - ktx2</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
<meta property="og:title" content="three.js webgl - exporter - ktx2">
<meta property="og:type" content="website">
<meta property="og:url" content="https://threejs.org/examples/misc_exporter_ktx2.html">
<meta property="og:image" content="https://threejs.org/examples/screenshots/misc_exporter_ktx2.jpg">
<link type="text/css" rel="stylesheet" href="main.css">
</head>
<body>
Expand Down
4 changes: 4 additions & 0 deletions examples/misc_exporter_obj.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
<title>three.js webgl - exporter - obj</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
<meta property="og:title" content="three.js webgl - exporter - obj">
<meta property="og:type" content="website">
<meta property="og:url" content="https://threejs.org/examples/misc_exporter_obj.html">
<meta property="og:image" content="https://threejs.org/examples/screenshots/misc_exporter_obj.jpg">
<link type="text/css" rel="stylesheet" href="main.css">
</head>
<body>
Expand Down
4 changes: 4 additions & 0 deletions examples/misc_exporter_ply.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
<title>three.js webgl - exporter - ply</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
<meta property="og:title" content="three.js webgl - exporter - ply">
<meta property="og:type" content="website">
<meta property="og:url" content="https://threejs.org/examples/misc_exporter_ply.html">
<meta property="og:image" content="https://threejs.org/examples/screenshots/misc_exporter_ply.jpg">
<link type="text/css" rel="stylesheet" href="main.css">
</head>
<body>
Expand Down
4 changes: 4 additions & 0 deletions examples/misc_exporter_stl.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
<title>three.js webgl - exporter - stl</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
<meta property="og:title" content="three.js webgl - exporter - stl">
<meta property="og:type" content="website">
<meta property="og:url" content="https://threejs.org/examples/misc_exporter_stl.html">
<meta property="og:image" content="https://threejs.org/examples/screenshots/misc_exporter_stl.jpg">
<link type="text/css" rel="stylesheet" href="main.css">
</head>
<body>
Expand Down
4 changes: 4 additions & 0 deletions examples/misc_exporter_usdz.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
<title>three.js webgl - USDZ exporter</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
<meta property="og:title" content="three.js webgl - USDZ exporter">
<meta property="og:type" content="website">
<meta property="og:url" content="https://threejs.org/examples/misc_exporter_usdz.html">
<meta property="og:image" content="https://threejs.org/examples/screenshots/misc_exporter_usdz.jpg">
<link type="text/css" rel="stylesheet" href="main.css">
<style>
body {
Expand Down
Loading
Loading