forked from mrdoob/three.js
-
Notifications
You must be signed in to change notification settings - Fork 0
Migration
mrdoob edited this page Nov 15, 2012
·
60 revisions
##r52 → r53dev
-
Sprite
now doesn't get anymore size automatically from the image size, usesprite.scale.set( imageWidth, imageHeight, 1.0 )
to achieve the old behavior -
SceneLoader
and scene format now usewidthSegments
,heightSegments
,depthSegments
instead ofsegmentsWidth
,segmentsHeight
,segmentsDepth
for definitions of plane, cube and sphere geometries -
SceneLoader
and scene format now usematerial
property with single material id string instead ofmaterials
array for meshes -
MeshPhongMaterial
now usesperPixel = true
by default -
WebGLRenderer
constructor doesn't use anymoremaxLights
parameter: shaders will be generated with the exact number of lights in the scene (it's now up to the application layer to make sure shaders compile on a particular system) -
ColorUtils.rgbToHsv()
got moved intoColor.getHSV()
-
Geometry
no longer has amaterials
property.MeshFaceMaterials
usage is now like this:new THREE.Mesh( geometry, new THREE.MeshFaceMaterials( [ material1, material2 ] ) )
. Meaning thatface.materialIndex
will map the array passed toMeshFaceMaterials
. -
GeometryUtils.clone()
is not a method inGeometry
.
##r51 → r52
-
ShaderExtras
have been split in a different files.CopyShader
,FXAAShader
,NormalShader
, etc - Replaced
SceneUtils.traverseHierarchy
withobject.traverse
. - Removed
SceneUtils.showHierarchy
. Useobject.traverse( function ( child ) { child.visible = false } )
instead. - Moved
*Controls
toexamples/js/controls
. - Split
SceneUtils.cloneObject
into*.clone()
##r50 → r51
-
CameraHelper
API changes: helper is not anymore child of camera, instead it uses reference to camera world matrix - texture uniform changes: texture units are now assigned automatically, texture object goes to
value
property instead oftexture
one{ type: "t", value: 0, texture: map }
=>{ type: "t", value: map }
-
normalScale
uniform in normal map shader is nowVector2
(to be able to invert separatelyx
andy
to deal with different tangent bases) -
CTMLoader.load
andCTMLoader.loadParts
now use single parameter object foruseWorker
anduseBuffers
:loader.load( url, callback, useWorker, useBuffers )
=>loader.load( url, callback, { useWorker: true, useBuffers: true } )
-
CTMLoader
now createsBufferGeometry
by default, setuseBuffers
parameter tofalse
if you needGeometry
- type for non-procedural geometries changed in the scene format:
ascii_mesh
=>ascii
,bin_mesh
=>binary
,embedded_mesh
=>embedded
-
UTF8Loader
(and compressor) were changed to a newer version, supporting more recent version of UTF8 format (r100+
); loader doesn't create anymore geometries but instead it returns hierarchy with potentially multiple meshes created per each material (or by splitting large model)
##r49 → r50
-
Vector3
's.getRotationFromMatrix( matrix, scale )
toVector3
's.setEulerFromRotationMatrix( matrix, order )
. -
Vector3
's.getEulerXYZFromQuaternion( quaternion )
and.getEulerYZXFromQuaternion( quaternion )
to.setEulerFromQuaternion( quaternion, order )
. -
DOMRenderer
andSVGRenderer
no longer included in common build. - texture coordinates aren't anymore flipped in the geometries, instead textures have
flipY
property (true by default); all models need to be re-exported / reconverted (tools have been updated as well).
workaround:uv.v = 1 - uv.v;
-
PlaneGeometry
changed back to vertical orientation (facing screen instead of laying on the ground).
workaround:mesh.rotation.x = - Math.PI / 2;
orgeometry.applyMatrix( new THREE.Matrix4().makeRotationX( - Math.PI / 2 ) );
-
doubleSided
/flipSided
properties moved fromObject3D
toMaterial
'sside
property (THREE.FrontSide
,THREE.BackSide
andTHREE.DoubleSide
). -
objectMatrix
in shaders was renamed tomodelMatrix
. - JIT caching removed from
Animation
. -
geometry.dynamic
is nowtrue
by default. -
Three.js
build renamed tothree.min.js
.
##r48 → r49
- changed
PlaneGeometry
from vertical to horizontal orientation. - renamed
__dirtyXXX
attribute properties toxxxNeedUpdate
. - removed
Vertex
class, useVector3
instead.
##r47 → r48
- Removed
intersectScene
fromRay
. UseintersectObjects( array )
instead.
##r45 → r46
-
loader.load( { model: url, callback: callback } )
toloader.load( url, callback )
.