提交 9d5e8359 编写于 作者: M Mr.doob

r119

上级 38af1e87
此差异已折叠。
此差异已折叠。
此差异已折叠。
......@@ -24,16 +24,6 @@
[page:constant CullFaceFrontBack] culls both front and back faces.
</p>
<h2>Front Face Direction</h2>
<code>
THREE.FrontFaceDirectionCW
THREE.FrontFaceDirectionCCW
</code>
<p>
[page:constant FrontFaceDirectionCW] sets the winding order for polygons to clockwise.<br />
[page:constant FrontFaceDirectionCCW] sets the winding order for polygons to counter-clockwise (default).
</p>
<h2>Shadow Types</h2>
<code>
THREE.BasicShadowMap
......
......@@ -50,9 +50,9 @@
Optional name for this attribute instance. Default is an empty string.
</p>
<h3>[property:Integer offset]</h3>
<h3>[property:Boolean needsUpdate]</h3>
<p>
The offset in the underlying array buffer where an item starts.
Default is *false*. Setting this to *true* will send the entire interleaved buffer (not just the specific attribute data) to the GPU again.
</p>
<h3>[property:Boolean normalized]</h3>
......@@ -60,6 +60,11 @@
Default is *false*.
</p>
<h3>[property:Integer offset]</h3>
<p>
The offset in the underlying array buffer where an item starts.
</p>
<h2>Methods</h2>
<h3>[method:this applyMatrix4]( [param:Matrix4 m] )</h3>
......
......@@ -49,8 +49,8 @@
<h3>[method:null closePath]()</h3>
<p>Adds a [page:LineCurve lineCurve] to close the path.</p>
<h3>[method:Float getCurveLengths]()</h3>
<p>Adds together the lengths of the curves in the [page:.curves] array.</p>
<h3>[method:Array getCurveLengths]()</h3>
<p>Get list of cumulative curve lengths of the curves in the [page:.curves] array.</p>
<h3>[method:Vector getPoint]( [param:Float t] )</h3>
<p>
......
......@@ -24,7 +24,7 @@
</li>
<li>
<b>Physically-based transparency:</b> One limitation of [page:Material.opacity .opacity] is
that highly transparent materials are less reflective. Physically-based [page:.transparency]
that highly transparent materials are less reflective. Physically-based [page:.transmission]
provides a more realistic option for thin, transparent surfaces like glass.
</li>
<li>
......@@ -62,7 +62,7 @@
[example:webgl_materials_variations_physical materials / variations / physical]<br />
[example:webgl_materials_physical_clearcoat materials / physical / clearcoat]<br />
[example:webgl_materials_physical_reflectivity materials / physical / reflectivity]<br />
[example:webgl_materials_physical_transparency materials / physical / transparency]
[example:webgl_materials_physical_transmission materials / physical / transmission]
</p>
<h2>Constructor</h2>
......@@ -128,15 +128,21 @@
This models the reflectivity of non-metallic materials. It has no effect when [page:MeshStandardMaterial.metalness metalness] is *1.0*
</p>
<h3>[property:Float transparency]</h3>
<h3>[property:Float transmission]</h3>
<p>
Degree of transparency, from *0.0* to *1.0*. Default is *0.0*.<br />
Degree of transmission (or optical transparency), from *0.0* to *1.0*. Default is *0.0*.<br />
Thin, transparent or semitransparent, plastic or glass materials remain largely reflective even if they are mostly transparent.
Thin, transparent or semitransparent, plastic or glass materials remain largely reflective even if they are fully transmissive.
The transparency property can be used to model these materials.<br />
The transmission property can be used to model these materials.<br />
When transparency is non-zero, [page:Material.opacity opacity] should be set to *1*.
When transmission is non-zero, [page:Material.opacity opacity] should be set to *1*.
</p>
<h3>[property:Texture transmissionMap]</h3>
<p>
The red channel of this texture is multiplied against [page:.transmission], for per-pixel control
over optical transparency. Default is *null*.
</p>
<h2>Methods</h2>
......
......@@ -66,9 +66,6 @@
<h3>[property:Color color]</h3>
<p>[page:Color] of the material, by default set to white (0xffffff). The [page:.map] is mutiplied by the color.</p>
<h3>[property:boolean fog]</h3>
<p>Whether or not this material affected by the scene's fog. Default is false</p>
<h3>[property:Texture map]</h3>
<p>The texture map. Default is null.</p>
......
......@@ -83,6 +83,9 @@
<h3>[method:Integer randInt]( [param:Integer low], [param:Integer high] )</h3>
<p>Random integer in the interval [page:Float low] to [page:Float high].</p>
<h3>[method:Float seededRandom]( [param:Integer seed] )</h3>
<p>Deterministic pseudo-random float in the interval [ 0, 1 ]. The integer [page:Integer seed] is optional.</p>
<h3>[method:Float smoothstep]( [param:Float x], [param:Float min], [param:Float max] )</h3>
<p>
[page:Float x] - The value to evaluate based on its position between min and max. <br />
......
......@@ -98,6 +98,11 @@
from an array.
</p>
<h3>[method:Quaternion identity]()</h3>
<p>
Sets this quaternion to the identity quaternion; that is, to the quaternion that represents "no rotation".
</p>
<h3>[method:Quaternion inverse]()</h3>
<p>
Inverts this quaternion - calculates the [page:.conjugate conjugate]. The quaternion is assumed to have unit length.
......
......@@ -24,16 +24,6 @@
[page:constant CullFaceFrontBack] 剔除正面和背面。
</p>
<h2>正面方向</h2>
<code>
THREE.FrontFaceDirectionCW
THREE.FrontFaceDirectionCCW
</code>
<p>
[page:constant FrontFaceDirectionCW] 将多边形的缠绕顺序设置为顺时针方向。 <br />
[page:constant FrontFaceDirectionCCW] 为默认值,将多边形的缠绕顺序设置为逆时针方向。
</p>
<h2>阴影类型</h2>
<code>
THREE.BasicShadowMap
......
......@@ -49,9 +49,9 @@
Optional name for this attribute instance. Default is an empty string.
</p>
<h3>[property:Integer offset]</h3>
<h3>[property:Boolean needsUpdate]</h3>
<p>
缓存队列中每个元素的起始位置的偏移量。
Default is *false*. Setting this to *true* will send the entire interleaved buffer (not just the specific attribute data) to the GPU again.
</p>
<h3>[property:Boolean normalized]</h3>
......@@ -59,6 +59,11 @@
默认值为 *false*。
</p>
<h3>[property:Integer offset]</h3>
<p>
缓存队列中每个元素的起始位置的偏移量。
</p>
<h2>方法</h2>
<h3>[method:Number getX]( [param:Integer index] ) </h3>
......
......@@ -49,8 +49,8 @@
<h3>[method:null closePath]()</h3>
<p>添加一条[page:LineCurve lineCurve]用于闭合路径。</p>
<h3>[method:Float getCurveLengths]()</h3>
<p>将[page:.curves]数组中曲线的长度相加。</p>
<h3>[method:Array getCurveLengths]()</h3>
<p>Get list of cumulative curve lengths of the curves in the [page:.curves] array.</p>
<h3>[method:Vector getPoint]( [param:Float t] )</h3>
<p>
......
......@@ -24,7 +24,7 @@
</li>
<li>
<b>Physically-based transparency:</b> One limitation of [page:Material.opacity .opacity] is
that highly transparent materials are less reflective. Physically-based [page:.transparency]
that highly transparent materials are less reflective. Physically-based [page:.transmission]
provides a more realistic option for thin, transparent surfaces like glass.
</li>
<li>
......@@ -63,7 +63,7 @@
[example:webgl_materials_variations_physical materials / variations / physical]<br />
[example:webgl_materials_physical_clearcoat materials / physical / clearcoat]<br />
[example:webgl_materials_physical_reflectivity materials / physical / reflectivity]<br />
[example:webgl_materials_physical_transparency materials / physical / transparency]
[example:webgl_materials_physical_transmission materials / physical / transmission]
</p>
<h2>构造函数(Constructor)</h2>
......@@ -123,15 +123,21 @@
这模拟了非金属材质的反射率。当[page:MeshStandardMaterial]为*1.0*时,此属性无效。
</p>
<h3>[property:Float transparency]</h3>
<h3>[property:Float transmission]</h3>
<p>
Degree of transparency, from *0.0* to *1.0*. Default is *0.0*.<br />
Degree of transmission (or optical transparency), from *0.0* to *1.0*. Default is *0.0*.<br />
Thin, transparent or semitransparent, plastic or glass materials remain largely reflective even if they are mostly transparent.
Thin, transparent or semitransparent, plastic or glass materials remain largely reflective even if they are fully transmissive.
The transparency property can be used to model these materials.<br />
The transmission property can be used to model these materials.<br />
When transparency is non-zero, [page:Material.opacity opacity] should be set to *1*.
When transmission is non-zero, [page:Material.opacity opacity] should be set to *1*.
</p>
<h3>[property:Texture transmissionMap]</h3>
<p>
The red channel of this texture is multiplied against [page:.transmission], for per-pixel control
over optical transparency. Default is *null*.
</p>
<h2>方法(Methods)</h2>
......
......@@ -64,9 +64,6 @@
<h3>[property:Color color]</h3>
<p>材质的颜色([page:Color]),默认值为白色 (0xffffff)。 [page:.map]会和 color 相乘。</p>
<h3>[property:boolean fog]</h3>
<p>材质是否受场景雾的影响。默认值为*false*。</p>
<h3>[property:Texture map]</h3>
<p>颜色贴图。默认为null。</p>
......
......@@ -80,6 +80,9 @@
<h3>[method:Integer randInt]( [param:Integer low], [param:Integer high] )</h3>
<p>在区间[page:Float low] 到 [page:Float high]随机一个整数。</p>
<h3>[method:Float seededRandom]( [param:Integer seed] )</h3>
<p>Deterministic pseudo-random float in the interval [ 0, 1 ]. The integer [page:Integer seed] is optional.</p>
<h3>[method:Float smoothstep]( [param:Float x], [param:Float min], [param:Float max] )</h3>
<p>
[page:Float x] - 根据其在最小值和最大值之间的位置来计算的值。 <br />
......
......@@ -98,6 +98,11 @@
from an array.
</p>
<h3>[method:Quaternion identity]()</h3>
<p>
Sets this quaternion to the identity quaternion; that is, to the quaternion that represents "no rotation".
</p>
<h3>[method:Quaternion inverse]()</h3>
<p>
Inverts this quaternion - calculates the [page:.conjugate conjugate]. The quaternion is assumed to have unit length.
......
......@@ -107,7 +107,7 @@
<h3>[property:Boolean enabled]</h3>
<p>
Whether or not the controls are enabled.
When set to *false*, the controls will not respond to user input. Default is *true*.
</p>
<h3>[property:Boolean enableDamping]</h3>
......
......@@ -30,10 +30,12 @@
<ul>
<li>KHR_draco_mesh_compression</li>
<li>KHR_materials_clearcoat</li>
<li>KHR_materials_pbrSpecularGlossiness</li>
<li>KHR_materials_unlit</li>
<li>KHR_mesh_quantization</li>
<li>KHR_lights_punctual<sup>1</sup></li>
<li>KHR_texture_basisu <i>(experimental)</i></li>
<li>KHR_texture_transform<sup>2</sup></li>
<li>MSFT_texture_dds</li>
</ul>
......@@ -44,7 +46,7 @@
<p><i>
<sup>2</sup>UV transforms are supported, with several key limitations. Transforms applied to
a texture using the first UV slot (all textures except aoMap and lightMap) must share the same
transform, or no transfor at all. The aoMap and lightMap textures cannot be transformed. No
transform, or no transform at all. The aoMap and lightMap textures cannot be transformed. No
more than one transform may be used per material. Each use of a texture with a unique
transform will result in an additional GPU texture upload. See
#[link:https://github.com/mrdoob/three.js/pull/13831 13831] and
......
......@@ -213,7 +213,7 @@
<h2>Source</h2>
<p>
[link:https://github.com/mrdoob/three.js/blob/master/examples/jsm/math/ConvexHull.js examples/jsm/ConvexHull.js]
[link:https://github.com/mrdoob/three.js/blob/master/examples/jsm/math/ConvexHull.js examples/jsm/math/ConvexHull.js]
</p>
</body>
</html>
......@@ -59,6 +59,11 @@
Tells the renderer to clear its drawing surface.
</p>
<h3>[method:Object getSize]()</h3>
<p>
Returns an object containing the width and height of the renderer.
</p>
<h3>[method:null render]( [param:Scene scene], [param:Camera camera] )</h3>
<p>
Renders a [page:Scene scene] using a [page:Camera camera].
......
......@@ -106,7 +106,7 @@
<h3>[property:Boolean enabled]</h3>
<p>
控制器是否被启用。
When set to *false*, the controls will not respond to user input. Default is *true*.
</p>
<h3>[property:Boolean enableDamping]</h3>
......
......@@ -28,10 +28,12 @@
<ul>
<li>KHR_draco_mesh_compression</li>
<li>KHR_materials_clearcoat</li>
<li>KHR_materials_pbrSpecularGlossiness</li>
<li>KHR_materials_unlit</li>
<li>KHR_mesh_quantization</li>
<li>KHR_lights_punctual<sup>1</sup></li>
<li>KHR_texture_basisu <i>(experimental)</i></li>
<li>KHR_texture_transform<sup>2</sup></li>
<li>MSFT_texture_dds</li>
</ul>
......
......@@ -213,7 +213,7 @@
<h2>Source</h2>
<p>
[link:https://github.com/mrdoob/three.js/blob/master/examples/jsm/math/ConvexHull.js examples/jsm/ConvexHull.js]
[link:https://github.com/mrdoob/three.js/blob/master/examples/jsm/math/ConvexHull.js examples/jsm/math/ConvexHull.js]
</p>
</body>
</html>
......@@ -52,6 +52,11 @@
告诉渲染器来清除其绘图表面。
</p>
<h3>[method:Object getSize]()</h3>
<p>
返回一个包含有渲染器宽和高的对象。
</p>
<h3>[method:null render]( [param:Scene scene], [param:Camera camera] )</h3>
<p>
使用[page:Camera camera]来渲染一个[page:Scene scene]。
......
......@@ -71,10 +71,6 @@
import { OrbitControls } from '../../examples/jsm/controls/OrbitControls.js';
import { ParametricGeometries } from '../../examples/jsm/geometries/ParametricGeometries.js';
/**
* @author TatumCreative (Greg Tatum) / http://gregtatum.com/
*/
var twoPi = Math.PI * 2;
function updateGroupGeometry( mesh, geometry ) {
......
......@@ -62,10 +62,6 @@
import { GUI } from '../../examples/jsm/libs/dat.gui.module.js';
/**
* @author TatumCreative (Greg Tatum) / http://gregtatum.com/
*/
var constants = {
combine: {
......
/**
* @author dforrer / https://github.com/dforrer
* Developed as part of a project at University of Applied Sciences and Arts Northwestern Switzerland (www.fhnw.ch)
*/
/**
* @param editor pointer to main editor object used to initialize
......
/**
* @author mrdoob / http://mrdoob.com/
*/
function Config() {
var name = 'threejs-editor';
......
/**
* @author mrdoob / http://mrdoob.com/
*/
import * as THREE from '../../build/three.module.js';
import { Config } from './Config.js';
......@@ -10,12 +6,12 @@ import { History as _History } from './History.js';
import { Strings } from './Strings.js';
import { Storage as _Storage } from './Storage.js';
function Editor() {
var _DEFAULT_CAMERA = new THREE.PerspectiveCamera( 50, 1, 0.01, 1000 );
_DEFAULT_CAMERA.name = 'Camera';
_DEFAULT_CAMERA.position.set( 0, 5, 10 );
_DEFAULT_CAMERA.lookAt( new THREE.Vector3() );
this.DEFAULT_CAMERA = new THREE.PerspectiveCamera( 50, 1, 0.01, 1000 );
this.DEFAULT_CAMERA.name = 'Camera';
this.DEFAULT_CAMERA.position.set( 0, 5, 10 );
this.DEFAULT_CAMERA.lookAt( new THREE.Vector3() );
function Editor() {
var Signal = signals.Signal;
......@@ -51,6 +47,7 @@ function Editor() {
sceneRendered: new Signal(),
cameraChanged: new Signal(),
cameraResetted: new Signal(),
geometryChanged: new Signal(),
......@@ -78,6 +75,7 @@ function Editor() {
windowResize: new Signal(),
showGridChanged: new Signal(),
showHelpersChanged: new Signal(),
refreshSidebarObject3D: new Signal(),
historyChanged: new Signal(),
......@@ -92,7 +90,7 @@ function Editor() {
this.loader = new Loader( this );
this.camera = this.DEFAULT_CAMERA.clone();
this.camera = _DEFAULT_CAMERA.clone();
this.scene = new THREE.Scene();
this.scene.name = 'Scene';
......@@ -531,7 +529,7 @@ Editor.prototype = {
setViewportCamera: function ( uuid ) {
this.viewportCamera = this.cameras[ uuid ];
this.signals.viewportCameraChanged.dispatch( this.viewportCamera );
this.signals.viewportCameraChanged.dispatch();
},
......@@ -612,7 +610,8 @@ Editor.prototype = {
this.history.clear();
this.storage.clear();
this.camera.copy( this.DEFAULT_CAMERA );
this.camera.copy( _DEFAULT_CAMERA );
this.signals.cameraResetted.dispatch();
this.scene.name = "Scene";
this.scene.userData = {};
......@@ -654,8 +653,7 @@ Editor.prototype = {
var camera = loader.parse( json.camera );
this.camera.copy( camera );
this.camera.aspect = this.DEFAULT_CAMERA.aspect;
this.camera.updateProjectionMatrix();
this.signals.cameraResetted.dispatch();
this.history.fromJSON( json.history );
this.scripts = json.scripts;
......
/**
* @author qiao / https://github.com/qiao
* @author mrdoob / http://mrdoob.com
* @author alteredq / http://alteredqualia.com/
* @author WestLangley / http://github.com/WestLangley
*/
import * as THREE from '../../build/three.module.js';
function EditorControls( object, domElement ) {
......
/**
* @author dforrer / https://github.com/dforrer
* Developed as part of a project at University of Applied Sciences and Arts Northwestern Switzerland (www.fhnw.ch)
*/
import * as Commands from './commands/Commands.js';
......@@ -69,6 +65,7 @@ History.prototype = {
cmd.id = ++ this.idCounter;
}
cmd.name = ( optionalName !== undefined ) ? optionalName : cmd.name;
cmd.execute();
cmd.inMemory = true;
......@@ -78,6 +75,7 @@ History.prototype = {
cmd.json = cmd.toJSON(); // serialize the cmd immediately after execution and append the json to the cmd
}
this.lastCmdTime = new Date();
// clearing all the redo-commands
......@@ -307,6 +305,7 @@ History.prototype = {
cmd.json = cmd.toJSON();
}
cmd = this.redo();
}
......
/**
* @author mrdoob / http://mrdoob.com/
*/
import * as THREE from '../../build/three.module.js';
import { ThreeMFLoader } from '../../examples/jsm/loaders/3MFLoader.js';
......@@ -21,6 +17,8 @@ import { TDSLoader } from '../../examples/jsm/loaders/TDSLoader.js';
import { VTKLoader } from '../../examples/jsm/loaders/VTKLoader.js';
import { VRMLLoader } from '../../examples/jsm/loaders/VRMLLoader.js';
import { TGALoader } from '../../examples/jsm/loaders/TGALoader.js';
import { AddObjectCommand } from './commands/AddObjectCommand.js';
import { SetSceneCommand } from './commands/SetSceneCommand.js';
......@@ -67,6 +65,8 @@ function Loader( editor ) {
} );
manager.addHandler( /\.tga$/i, new TGALoader() );
for ( var i = 0; i < files.length; i ++ ) {
scope.loadFile( files[ i ], manager );
......@@ -650,7 +650,12 @@ function Loader( editor ) {
case 'glb':
var dracoLoader = new DRACOLoader();
dracoLoader.setDecoderPath( '../examples/js/libs/draco/gltf/' );
var loader = new GLTFLoader();
loader.setDRACOLoader( dracoLoader );
loader.parse( file.asArrayBuffer(), '', function ( result ) {
var scene = result.scene;
......@@ -664,7 +669,11 @@ function Loader( editor ) {
case 'gltf':
var dracoLoader = new DRACOLoader();
dracoLoader.setDecoderPath( '../examples/js/libs/draco/gltf/' );
var loader = new GLTFLoader( manager );
loader.setDRACOLoader( dracoLoader );
loader.parse( file.asText(), '', function ( result ) {
var scene = result.scene;
......
/**
* @author mrdoob / http://mrdoob.com/
*/
var LoaderUtils = {
createFilesMap: function ( files ) {
......@@ -77,7 +73,13 @@ var LoaderUtils = {
for ( var i = 0; i < items.length; i ++ ) {
handleEntry( items[ i ].webkitGetAsEntry() );
var item = items[ i ];
if ( item.kind === 'file' ) {
handleEntry( item.webkitGetAsEntry() );
}
}
......
/**
* @author mrdoob / http://mrdoob.com/
*/
import * as THREE from '../../build/three.module.js';
import { UIPanel, UIRow, UIHorizontalRule } from './libs/ui.js';
......
/**
* @author mrdoob / http://mrdoob.com/
*/
import { UIPanel, UIRow, UIHorizontalRule } from './libs/ui.js';
import { AddObjectCommand } from './commands/AddObjectCommand.js';
......
/**
* @author mrdoob / http://mrdoob.com/
*/
import * as THREE from '../../build/three.module.js';
import { UIPanel, UIRow } from './libs/ui.js';
......
/**
* @author mrdoob / http://mrdoob.com/
*/
import * as THREE from '../../build/three.module.js';
import { ColladaExporter } from '../../examples/jsm/exporters/ColladaExporter.js';
......
/**
* @author mrdoob / http://mrdoob.com/
*/
import { UIPanel, UIRow } from './libs/ui.js';
function MenubarHelp( editor ) {
......
/**
* @author mrdoob / http://mrdoob.com/
*/
import { UIPanel } from './libs/ui.js';
function MenubarPlay( editor ) {
......
/**
* @author mrdoob / http://mrdoob.com/
*/
import * as THREE from '../../build/three.module.js';
import { UIPanel, UIText } from './libs/ui.js';
......
/**
* @author mrdoob / http://mrdoob.com/
*/
import { UIPanel, UIRow } from './libs/ui.js';
function MenubarView( editor ) {
......
/**
* @author mrdoob / http://mrdoob.com/
*/
import { UIPanel } from './libs/ui.js';
import { MenubarAdd } from './Menubar.Add.js';
......
/**
* @author mrdoob / http://mrdoob.com/
*/
import { UIPanel } from './libs/ui.js';
import { APP } from './libs/app.js';
......
/**
* @author mrdoob / http://mrdoob.com/
*/
import { UIElement, UIPanel, UIText } from './libs/ui.js';
import { SetScriptValueCommand } from './commands/SetScriptValueCommand.js';
......
/**
* @author mrdoob / http://mrdoob.com/
*/
import { UIPanel, UIDiv, UIBreak, UISelect, UIButton, UIText } from './libs/ui.js';
function SidebarAnimation( editor ) {
......
/**
* @author mrdoob / http://mrdoob.com/
*/
import * as THREE from '../../build/three.module.js';
import { UIRow, UIText, UINumber, UIInteger } from './libs/ui.js';
......
/**
* @author mrdoob / http://mrdoob.com/
*/
import { UIRow, UIText, UISpan, UIBreak } from './libs/ui.js';
function SidebarGeometryBufferGeometry( editor ) {
......
/**
* @author mrdoob / http://mrdoob.com/
*/
import * as THREE from '../../build/three.module.js';
import { UIRow, UIText, UIInteger, UINumber } from './libs/ui.js';
......
/**
* @author mrdoob / http://mrdoob.com/
*/
import * as THREE from '../../build/three.module.js';
import { UIRow, UIText, UIInteger, UICheckbox, UINumber } from './libs/ui.js';
......
/**
* @author mrdoob / http://mrdoob.com/
*/
import * as THREE from '../../build/three.module.js';
import { UIRow, UIText, UIInteger, UINumber } from './libs/ui.js';
......
/**
* @author Temdog007 / http://github.com/Temdog007
*/
import * as THREE from '../../build/three.module.js';
import { UIRow, UIText, UIInteger, UICheckbox, UIButton, UINumber } from './libs/ui.js';
......
/**
* @author mrdoob / http://mrdoob.com/
*/
import { UIRow, UIText } from './libs/ui.js';
function SidebarGeometryGeometry( editor ) {
......
/**
* @author mrdoob / http://mrdoob.com/
*/
import * as THREE from '../../build/three.module.js';
import { UIRow, UIText, UIInteger, UINumber } from './libs/ui.js';
......
/**
* @author rfm1201
*/
import * as THREE from '../../build/three.module.js';
import { UIRow, UIText, UIInteger, UINumber } from './libs/ui.js';
......
/**
* @author mrdoob / http://mrdoob.com/
*/
import { UIRow, UIButton } from './libs/ui.js';
function SidebarGeometryModifiers( editor, object ) {
......
/**
* @author Temdog007 / http://github.com/Temdog007
*/
import * as THREE from '../../build/three.module.js';
import { UIRow, UIText, UIInteger, UINumber } from './libs/ui.js';
......
/**
* @author mrdoob / http://mrdoob.com/
*/
import * as THREE from '../../build/three.module.js';
import { UIRow, UIText, UIInteger, UINumber } from './libs/ui.js';
......
/**
* @author Temdog007 / http://github.com/Temdog007
*/
import * as THREE from '../../build/three.module.js';
import { UIRow, UIText, UIInteger, UINumber } from './libs/ui.js';
......
/**
* @author Temdog007 / http://github.com/Temdog007
*/
import * as THREE from '../../build/three.module.js';
import { UIRow, UIText, UIInteger, UIButton } from './libs/ui.js';
......
/**
* @author mrdoob / http://mrdoob.com/
*/
import * as THREE from '../../build/three.module.js';
import { UIRow, UIText, UIInteger, UINumber } from './libs/ui.js';
......
/**
* @author tschw
*/
import { UIRow, UIText, UIInteger, UICheckbox, UINumber } from './libs/ui.js';
import { TeapotBufferGeometry } from '../../examples/jsm/geometries/TeapotBufferGeometry.js';
......
/**
* @author Temdog007 / http://github.com/Temdog007
*/
import * as THREE from '../../build/three.module.js';
import { UIRow, UIText, UIInteger, UINumber } from './libs/ui.js';
......
/**
* @author mrdoob / http://mrdoob.com/
*/
import * as THREE from '../../build/three.module.js';
import { UIRow, UIText, UIInteger, UINumber } from './libs/ui.js';
......
/**
* @author mrdoob / http://mrdoob.com/
*/
import * as THREE from '../../build/three.module.js';
import { UIRow, UIText, UIInteger, UINumber } from './libs/ui.js';
......
/**
* @author Temdog007 / http://github.com/Temdog007
*/
import * as THREE from '../../build/three.module.js';
import { UIRow, UIText, UIInteger, UISelect, UICheckbox, UINumber } from './libs/ui.js';
......
/**
* @author mrdoob / http://mrdoob.com/
*/
import * as THREE from '../../build/three.module.js';
import { UIPanel, UIRow, UIText, UIInput, UIButton, UISpan } from './libs/ui.js';
......
/**
* @author dforrer / https://github.com/dforrer
* Developed as part of a project at University of Applied Sciences and Arts Northwestern Switzerland (www.fhnw.ch)
*/
import { UIPanel, UIBreak, UIText } from './libs/ui.js';
import { UIBoolean, UIOutliner } from './libs/ui.three.js';
......
/**
* @author mrdoob / http://mrdoob.com/
*/
import * as THREE from '../../build/three.module.js';
import { UIPanel, UIRow, UIInput, UIButton, UIColor, UICheckbox, UISelect, UIText, UINumber } from './libs/ui.js';
......
/**
* @author mrdoob / http://mrdoob.com/
*/
import * as THREE from '../../build/three.module.js';
import { UIPanel, UIRow, UIInput, UIButton, UIColor, UICheckbox, UIInteger, UITextArea, UIText, UINumber } from './libs/ui.js';
......@@ -137,13 +133,11 @@ function SidebarObject( editor ) {
// scale
var objectScaleRow = new UIRow();
var objectScaleLock = new UICheckbox( true ).setPosition( 'absolute' ).setLeft( '75px' );
var objectScaleX = new UINumber( 1 ).setPrecision( 3 ).setRange( 0.001, Infinity ).setWidth( '50px' ).onChange( updateScaleX );
var objectScaleY = new UINumber( 1 ).setPrecision( 3 ).setRange( 0.001, Infinity ).setWidth( '50px' ).onChange( updateScaleY );
var objectScaleZ = new UINumber( 1 ).setPrecision( 3 ).setRange( 0.001, Infinity ).setWidth( '50px' ).onChange( updateScaleZ );
var objectScaleX = new UINumber( 1 ).setPrecision( 3 ).setWidth( '50px' ).onChange( update );
var objectScaleY = new UINumber( 1 ).setPrecision( 3 ).setWidth( '50px' ).onChange( update );
var objectScaleZ = new UINumber( 1 ).setPrecision( 3 ).setWidth( '50px' ).onChange( update );
objectScaleRow.add( new UIText( strings.getKey( 'sidebar/object/scale' ) ).setWidth( '90px' ) );
objectScaleRow.add( objectScaleLock );
objectScaleRow.add( objectScaleX, objectScaleY, objectScaleZ );
container.add( objectScaleRow );
......@@ -395,57 +389,6 @@ function SidebarObject( editor ) {
//
function updateScaleX() {
var object = editor.selected;
if ( objectScaleLock.getValue() === true ) {
var scale = objectScaleX.getValue() / object.scale.x;
objectScaleY.setValue( objectScaleY.getValue() * scale );
objectScaleZ.setValue( objectScaleZ.getValue() * scale );
}
update();
}
function updateScaleY() {
var object = editor.selected;
if ( objectScaleLock.getValue() === true ) {
var scale = objectScaleY.getValue() / object.scale.y;
objectScaleX.setValue( objectScaleX.getValue() * scale );
objectScaleZ.setValue( objectScaleZ.getValue() * scale );
}
update();
}
function updateScaleZ() {
var object = editor.selected;
if ( objectScaleLock.getValue() === true ) {
var scale = objectScaleZ.getValue() / object.scale.z;
objectScaleX.setValue( objectScaleX.getValue() * scale );
objectScaleY.setValue( objectScaleY.getValue() * scale );
}
update();
}
function update() {
var object = editor.selected;
......
/**
* @author mrdoob / http://mrdoob.com/
*/
import * as THREE from '../../build/three.module.js';
import { UIPanel, UIRow, UIInput, UICheckbox, UIText, UIListbox, UISpan, UIButton, UISelect, UINumber } from './libs/ui.js';
......
/**
* @author mrdoob / http://mrdoob.com/
*/
import { UITabbedPanel } from './libs/ui.js';
import { SidebarObject } from './Sidebar.Object.js';
......
/**
* @author mrdoob / http://mrdoob.com/
*/
import { UIPanel, UIBreak, UIRow, UIColor, UISelect, UIText, UINumber } from './libs/ui.js';
import { UIOutliner, UITexture } from './libs/ui.three.js';
......
/**
* @author mrdoob / http://mrdoob.com/
*/
import { UIPanel, UIBreak, UIText, UIButton, UIRow, UIInput } from './libs/ui.js';
import { AddScriptCommand } from './commands/AddScriptCommand.js';
......
/**
* @author TyLindberg / https://github.com/TyLindberg
*/
import { UIDiv, UIBreak, UIText, UIRow, UIInput } from './libs/ui.js';
import { RemoveObjectCommand } from './commands/RemoveObjectCommand.js';
......
/**
* @author mrdoob / http://mrdoob.com/
*/
import { UIDiv, UIBreak, UIText } from './libs/ui.js';
import { UIDiv, UIText, UIRow } from './libs/ui.js';
import { UIBoolean } from './libs/ui.three.js';
......@@ -12,28 +8,34 @@ function SidebarSettingsViewport( editor ) {
var strings = editor.strings;
var container = new UIDiv();
container.add( new UIBreak() );
container.add( new UIText( strings.getKey( 'sidebar/settings/viewport/grid' ) ).setWidth( '90px' ) );
// grid
var showGridRow = new UIRow();
showGridRow.add( new UIText( strings.getKey( 'sidebar/settings/viewport/grid' ) ).setWidth( '90px' ) );
var showGrid = new UIBoolean( true ).onChange( function () {
signals.showGridChanged.dispatch( showGrid.getValue() );
var show = new UIBoolean( true ).onChange( update );
container.add( show );
} );
showGridRow.add( showGrid );
container.add( showGridRow );
/*
var snapSize = new UI.Number( 25 ).setWidth( '40px' ).onChange( update );
container.add( snapSize );
// helpers
var snap = new UI.THREE.Boolean( false, 'snap' ).onChange( update );
container.add( snap );
*/
var showHelpersRow = new UIRow();
function update() {
showHelpersRow.add( new UIText( strings.getKey( 'sidebar/settings/viewport/helpers' ) ).setWidth( '90px' ) );
signals.showGridChanged.dispatch( show.getValue() );
var showHelpers = new UIBoolean( true ).onChange( function () {
// signals.snapChanged.dispatch( snap.getValue() === true ? snapSize.getValue() : null );
signals.showHelpersChanged.dispatch( showHelpers.getValue() );
}
} );
showHelpersRow.add( showHelpers );
container.add( showHelpersRow );
return container;
......
/**
* @author mrdoob / http://mrdoob.com/
*/
import { UIPanel, UIRow, UISelect, UIText, UIInteger } from './libs/ui.js';
import { SidebarSettingsViewport } from './Sidebar.Settings.Viewport.js';
......
/**
* @author mrdoob / http://mrdoob.com/
*/
import { UITabbedPanel, UISpan } from './libs/ui.js';
import { SidebarScene } from './Sidebar.Scene.js';
......
/**
* @author mrdoob / http://mrdoob.com/
*/
function Storage() {
var indexedDB = window.indexedDB || window.mozIndexedDB || window.webkitIndexedDB || window.msIndexedDB;
......
/**
* @author mrdoob / http://mrdoob.com/
*/
function Strings( config ) {
var language = config.getKey( 'language' );
......@@ -310,6 +306,7 @@ function Strings( config ) {
'sidebar/settings/shortcuts/focus': 'Focus',
'sidebar/settings/viewport/grid': 'Grid',
'sidebar/settings/viewport/helpers': 'Helpers',
'sidebar/history': 'History',
'sidebar/history/persistent': 'persistent',
......@@ -628,6 +625,7 @@ function Strings( config ) {
'sidebar/settings/shortcuts/focus': 'Focus',
'sidebar/settings/viewport/grid': 'Grille',
'sidebar/settings/viewport/helpers': 'Helpers',
'sidebar/history': 'Historique',
'sidebar/history/persistent': 'permanent',
......@@ -839,6 +837,15 @@ function Strings( config ) {
'sidebar/geometry/torusKnot_geometry/p': '管长弧度',
'sidebar/geometry/torusKnot_geometry/q': '扭曲弧度',
'sidebar/geometry/tube_geometry/path': '路径',
'sidebar/geometry/tube_geometry/radius': '半径',
'sidebar/geometry/tube_geometry/tube': '管厚',
'sidebar/geometry/tube_geometry/tubularsegments': '管厚分段',
'sidebar/geometry/tube_geometry/radialsegments': '半径分段',
'sidebar/geometry/tube_geometry/closed': '闭合',
'sidebar/geometry/tube_geometry/curvetype': '曲线类型',
'sidebar/geometry/tube_geometry/tension': '张力',
'sidebar/material/new': '更新',
'sidebar/material/copy': '复制',
'sidebar/material/paste': '粘贴',
......@@ -920,6 +927,7 @@ function Strings( config ) {
'sidebar/settings/shortcuts/focus': '聚焦',
'sidebar/settings/viewport/grid': '网格',
'sidebar/settings/viewport/helpers': '辅助',
'sidebar/history': '历史记录',
'sidebar/history/persistent': '本地存储',
......
/**
* @author mrdoob / http://mrdoob.com/
*/
import { UIPanel, UIButton, UICheckbox } from './libs/ui.js';
function Toolbar( editor ) {
......
/**
* @author mrdoob / http://mrdoob.com/
*/
import { UISelect } from './libs/ui.js';
function ViewportCamera( editor ) {
......
/**
* @author mrdoob / http://mrdoob.com/
*/
import { UIPanel, UIBreak, UIText } from './libs/ui.js';
function ViewportInfo( editor ) {
......
此差异已折叠。
/**
* @author mrdoob / http://mrdoob.com/
*/
import * as THREE from '../../build/three.module.js';
import { TransformControls } from '../../examples/jsm/controls/TransformControls.js';
......@@ -12,6 +8,7 @@ import { EditorControls } from './EditorControls.js';
import { ViewportCamera } from './Viewport.Camera.js';
import { ViewportInfo } from './Viewport.Info.js';
import { ViewHelper } from './Viewport.ViewHelper.js';
import { SetPositionCommand } from './commands/SetPositionCommand.js';
import { SetRotationCommand } from './commands/SetRotationCommand.js';
......@@ -37,6 +34,7 @@ function Viewport( editor ) {
var camera = editor.camera;
var scene = editor.scene;
var sceneHelpers = editor.sceneHelpers;
var showSceneHelpers = true;
var objects = [];
......@@ -58,6 +56,10 @@ function Viewport( editor ) {
//
var viewHelper = new ViewHelper( camera, container );
//
var box = new THREE.Box3();
var selectionBox = new THREE.BoxHelper();
......@@ -160,6 +162,13 @@ function Viewport( editor ) {
// events
function updateAspectRatio() {
camera.aspect = container.dom.offsetWidth / container.dom.offsetHeight;
camera.updateProjectionMatrix();
}
function getIntersects( point, objects ) {
mouse.set( ( point.x * 2 ) - 1, - ( point.y * 2 ) + 1 );
......@@ -292,6 +301,7 @@ function Viewport( editor ) {
signals.refreshSidebarObject3D.dispatch( camera );
} );
viewHelper.controls = controls;
// signals
......@@ -633,23 +643,24 @@ function Viewport( editor ) {
} );
signals.viewportCameraChanged.add( function ( viewportCamera ) {
signals.viewportCameraChanged.add( function () {
var viewportCamera = editor.viewportCamera;
if ( viewportCamera.isPerspectiveCamera ) {
viewportCamera.aspect = editor.camera.aspect;
viewportCamera.projectionMatrix.copy( editor.camera.projectionMatrix );
} else if ( ! viewportCamera.isOrthographicCamera ) {
} else if ( viewportCamera.isOrthographicCamera ) {
throw "Invalid camera set as viewport";
// TODO
}
// Disable EditorControls when setting a user camera
controls.enabled = viewportCamera === editor.camera;
// disable EditorControls when setting a user camera
camera = viewportCamera;
controls.enabled = ( viewportCamera === editor.camera );
render();
......@@ -659,13 +670,7 @@ function Viewport( editor ) {
signals.windowResize.add( function () {
// TODO: Move this out?
editor.DEFAULT_CAMERA.aspect = container.dom.offsetWidth / container.dom.offsetHeight;
editor.DEFAULT_CAMERA.updateProjectionMatrix();
camera.aspect = container.dom.offsetWidth / container.dom.offsetHeight;
camera.updateProjectionMatrix();
updateAspectRatio();
renderer.setSize( container.dom.offsetWidth, container.dom.offsetHeight );
......@@ -680,6 +685,17 @@ function Viewport( editor ) {
} );
signals.showHelpersChanged.add( function ( showHelpers ) {
showSceneHelpers = showHelpers;
transformControls.enabled = showHelpers;
render();
} );
signals.cameraResetted.add( updateAspectRatio );
// animations
var clock = new THREE.Clock(); // only used for animations
......@@ -689,14 +705,26 @@ function Viewport( editor ) {
requestAnimationFrame( animate );
var mixer = editor.mixer;
var delta = clock.getDelta();
var needsUpdate = false;
if ( mixer.stats.actions.inUse > 0 ) {
mixer.update( clock.getDelta() );
render();
mixer.update( delta );
needsUpdate = true;
}
if ( viewHelper.animating === true ) {
viewHelper.update( delta );
needsUpdate = true;
}
if ( needsUpdate === true ) render();
}
requestAnimationFrame( animate );
......@@ -714,13 +742,15 @@ function Viewport( editor ) {
// don't render under the grid.
scene.add( grid );
renderer.render( scene, camera );
renderer.setViewport( 0, 0, container.dom.offsetWidth, container.dom.offsetHeight );
renderer.render( scene, editor.viewportCamera );
scene.remove( grid );
if ( camera === editor.camera ) {
if ( camera === editor.viewportCamera ) {
renderer.autoClear = false;
renderer.render( sceneHelpers, camera );
if ( showSceneHelpers === true ) renderer.render( sceneHelpers, camera );
viewHelper.render( renderer );
renderer.autoClear = true;
}
......
/**
* @author dforrer / https://github.com/dforrer
* Developed as part of a project at University of Applied Sciences and Arts Northwestern Switzerland (www.fhnw.ch)
*/
import { Command } from '../Command.js';
import * as THREE from '../../../build/three.module.js';
......
/**
* @author dforrer / https://github.com/dforrer
* Developed as part of a project at University of Applied Sciences and Arts Northwestern Switzerland (www.fhnw.ch)
*/
import { Command } from '../Command.js';
/**
......
/**
* @author dforrer / https://github.com/dforrer
* Developed as part of a project at University of Applied Sciences and Arts Northwestern Switzerland (www.fhnw.ch)
*/
import { Command } from '../Command.js';
/**
......@@ -95,12 +90,15 @@ MoveObjectCommand.prototype = {
this.oldParent = this.editor.scene;
}
this.newParent = this.editor.objectByUuid( json.newParentUuid );
if ( this.newParent === undefined ) {
this.newParent = this.editor.scene;
}
this.newIndex = json.newIndex;
this.oldIndex = json.oldIndex;
......
/**
* @author dforrer / https://github.com/dforrer
* Developed as part of a project at University of Applied Sciences and Arts Northwestern Switzerland (www.fhnw.ch)
*/
import { Command } from '../Command.js';
/**
......@@ -63,6 +58,7 @@ MultiCmdsCommand.prototype = {
cmds.push( this.cmdArray[ i ].toJSON() );
}
output.cmds = cmds;
return output;
......
/**
* @author dforrer / https://github.com/dforrer
* Developed as part of a project at University of Applied Sciences and Arts Northwestern Switzerland (www.fhnw.ch)
*/
import { Command } from '../Command.js';
......
/**
* @author dforrer / https://github.com/dforrer
* Developed as part of a project at University of Applied Sciences and Arts Northwestern Switzerland (www.fhnw.ch)
*/
import { Command } from '../Command.js';
/**
......
/**
* @author dforrer / https://github.com/dforrer
* Developed as part of a project at University of Applied Sciences and Arts Northwestern Switzerland (www.fhnw.ch)
*/
import { Command } from '../Command.js';
/**
......
/**
* @author dforrer / https://github.com/dforrer
* Developed as part of a project at University of Applied Sciences and Arts Northwestern Switzerland (www.fhnw.ch)
*/
import { Command } from '../Command.js';
import * as THREE from '../../../build/three.module.js';
......
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册