forked from mrdoob/three.js
-
Notifications
You must be signed in to change notification settings - Fork 0
Migration
wereHamster edited this page Mar 17, 2013
·
68 revisions
##r57 → r58dev
##r56 → r57
- For
BufferGeometry-
geometry.verticesNeedUpdatetogeometry.attributes.index.needsUpdate -
geometry.elementsNeedUpdatetogeometry.attributes.position.needsUpdate -
geometry.normalsNeedUpdatetogeometry.attributes.normal.needsUpdate -
geometry.uvsNeedUpdatetogeometry.attributes.uv.needsUpdate -
geometry.colorsNeedUpdatetogeometry.attributes.color.needsUpdate -
geometry.tangentsNeedUpdatetogeometry.attributes.tangent.needsUpdate -
*->geometry.attributes.custom.needsUpdate
-
- Removed
Matrix4'srotateAxis. UseVector3.transformDirection( matrix )instead. - Removed
AsteriskGeometry. - Removed
Color'ssetHSV. UseColorConverter.setHSV( color, h, s, v )instead.
##r55 → r56
- Removed
getPosition()andgetColumn*()fromMatrix4 -
Color.setHSV()andColor.getHSV()replaced by.setHSL()and.getHSL() - Replaced
ColorUtils.adjustHSV()with Color's.offsetHSL() - Renamed
Box3/Line3/Plane/Ray/Sphere's.transform()toapplyMatrix4()
##r54 → r55
-
Matrix3.multiplyVector3()changed toVector3.applyMatrix3() -
Matrix4.multiplyVector3()changed toVector3.applyMatrix4()andVector3.applyProjection() -
Matrix4.multiplyVector4()changed toVector4.applyMatrix4() -
Quaternion.multiplyVector3()changed toVector3.applyQuaternion() - Renamed
Colormethods:-
.lerpSelf()to.lerp()
-
- Renamed
Vector2,Vector3andVector4methods:-
.add()to.addVectors() -
.addSelf()to.add() -
.sub()to.subVectors() -
.subSelf()to.sub() -
.minSelf()to.min() -
.maxSelf()to.max() -
.clampSelf()to.clamp() -
.lerpSelf()to.lerp()
-
- Renamed
Matrix4methods:-
.multiply()to.multiplyMatrices() -
.multiplySelf()to.multiply()
-
- Renamed
Quaternionmethods:-
.multiply()to.multiplyQuaternions() -
.multiplySelf()to.multiply()
-
- Moved
GeometryUtils.explodetoExplodeModifier - Moved
GeometryUtils.tessellatetoTessellateModifier - Moved
ShaderUtils.libtoShaderLib -
Matrix4.makeTranslationandMatrix4.makeScalenow take three scalars instead ofVector3.
##r53 → r54
-
Spritematerial properties are now inSpriteMaterial, used like thisnew THREE.Sprite( new THREE.SpriteMaterial( { color: 0xff0000, map: texture, alphaTest: 0.5 } ) ). - Renamed migrated sprite material properies:
Sprite.affectedByDistance=>SpriteMaterial.sizeAttenuationandSprite.mergeWith3D=>SpriteMaterial.depthTest - Renamed
renderer.shadowMapCullFrontFaces=>renderer.shadowMapCullFace(default valuetrue=>THREE.CullFaceFront, other optionfalse=>THREE.CullFaceBack). - Renamed
color.getContextStyletocolor.getStyle. - Moved
Raycasting methods toRaycaster. -
Rectanglereplaced withBox2. -
UVreplaced withVector2. This means.uand.vare now.xand.y. -
Matrix4.makeTranslationandMatrix4.makeScalenow takeVector3instead of three scalars - Moved
SubdivisionModifierout of the build toexamples/js/modifiers.
##r52 → r53
-
Spritenow doesn't get anymore size automatically from the image size, usesprite.scale.set( imageWidth, imageHeight, 1.0 )to achieve the old behavior -
SceneLoaderand scene format now usewidthSegments,heightSegments,depthSegmentsinstead ofsegmentsWidth,segmentsHeight,segmentsDepthfor definitions of plane, cube and sphere geometries -
SceneLoaderand scene format now usematerialproperty with single material id string instead ofmaterialsarray for meshes -
MeshPhongMaterialnow usesperPixel = trueby default -
WebGLRendererconstructor doesn't use anymoremaxLightsparameter: 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() -
Geometryno longer has amaterialsproperty.MeshFaceMaterialsusage is now like this:new THREE.Mesh( geometry, new THREE.MeshFaceMaterials( [ material1, material2 ] ) ). Meaning thatface.materialIndexwill map the array passed toMeshFaceMaterials. - Loader callbacks which previously only had
geometryparameter, are now also passed a second one:materials:loader.load( 'file.js', function ( geometry, materials ) {} ). -
GeometryUtils.clone()is now a method inGeometry.
##r51 → r52
-
ShaderExtrashave been split in a different files.CopyShader,FXAAShader,NormalShader, etc - Replaced
SceneUtils.traverseHierarchywithobject.traverse. - Removed
SceneUtils.showHierarchy. Useobject.traverse( function ( child ) { child.visible = false } )instead. - Moved
*Controlstoexamples/js/controls. - Split
SceneUtils.cloneObjectinto*.clone()
##r50 → r51
-
CameraHelperAPI 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
valueproperty instead oftextureone{ type: "t", value: 0, texture: map }=>{ type: "t", value: map } -
normalScaleuniform in normal map shader is nowVector2(to be able to invert separatelyxandyto deal with different tangent bases) -
CTMLoader.loadandCTMLoader.loadPartsnow use single parameter object foruseWorkeranduseBuffers:loader.load( url, callback, useWorker, useBuffers )=>loader.load( url, callback, { useWorker: true, useBuffers: true } ) -
CTMLoadernow createsBufferGeometryby default, setuseBuffersparameter tofalseif 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 ). -
DOMRendererandSVGRendererno longer included in common build. - texture coordinates aren't anymore flipped in the geometries, instead textures have
flipYproperty (true by default); all models need to be re-exported / reconverted (tools have been updated as well).
workaround:uv.v = 1 - uv.v; -
PlaneGeometrychanged 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/flipSidedproperties moved fromObject3DtoMaterial'ssideproperty (THREE.FrontSide,THREE.BackSideandTHREE.DoubleSide). -
objectMatrixin shaders was renamed tomodelMatrix. - JIT caching removed from
Animation. -
geometry.dynamicis nowtrueby default. -
Three.jsbuild renamed tothree.min.js.
##r48 → r49
- changed
PlaneGeometryfrom vertical to horizontal orientation. - renamed
__dirtyXXXattribute properties toxxxNeedUpdate. - removed
Vertexclass, useVector3instead.
##r47 → r48
- Removed
intersectScenefromRay. UseintersectObjects( array )instead.
##r45 → r46
-
loader.load( { model: url, callback: callback } )toloader.load( url, callback ).