Version 2.0.0-beta1
Pre-release
Pre-release
·
389 commits
to master
since this release
Version 2.0.0-beta1:
There are many, many changes to version 2.0.0-beta1 from version 1.5.1. Here are some of them, including the most important ones.
- All classes in the main library are moved to a new namespace called
H3DU. For example,Shapeis nowH3DU.ShapeandMeshis nowH3DU.Mesh. Many classes in the "extras" directory are also moved to theH3DUnamespace. Scene3D, nowH3DU.Scene3D, is no longer meant to be a scene graph of objects to draw. That job now belongs to the newH3DU.Batch3Dclass. Scene3D'srendermethod now takes an array ofBatch3Ds to render. For compatibility, though, the methods allowing it to manage 3D models and the coordinate system, such asmakeShapeandsetPerspective, can still be used untilH3DU.Scene3Drenders a customH3DU.Batch3D. This compatibility behavior may be dropped in the future.- Alpha is disabled in WebGL contexts created with the
H3DU.get3DOr2DContextmethod. - The
Scene3DH3DU.Scene3D#useProgrammethod was deprecated and now does nothing. - New
H3DU.RenderPass3Dclass holds information about how a batch of 3D models is to be rendered. It replaces theScene3DH3DU.Scene3D#useFiltermethod, which now does nothing. - New
H3DU.FrameBufferInfoclass holds information about a frame buffer; it replacesH3DU.FrameBuffer. - The
BufferedMesh,FrameBuffer, andShaderProgramclasses are deprecated because they are too tightly coupled with a particular WebGL context. Instead, useH3DU.MeshBuffer,H3DU.FrameBufferInfo, andH3DU.ShaderInfo, respectively, which are not coupled to WebGL contexts. - Rendering can make use of vertex array objects internally, if supported by the WebGL implementation.
- The
H3DU.Shapeobject is no longer coupled to vertex buffers. - The
H3DU.LightSourceclass now supports a radius of the light. - The
H3DU.TextureLoaderclass was added for loading textures; a single object of this class can load and upload images from multiple WebGL contexts. This is unlikeBufferedMesh,FrameBuffer, andShaderProgram, which are tied to the WebGL context. GLMath, nowH3DU.Math, was expanded with many new methods. The documentation for it is now very detailed. New methods includeH3DU.Math.vec3perp,H3DU.Math.vec3toWindowPoint, andH3DU.Math.mat4projectVec3.- Two new classes in the "extras" folder support 2D text rendering and texture atlases (as sprite sheets), namely,
H3DU.TextFontandH3DU.TextureAtlas. - The "doc" folder contains the documentation to the library in the form of Markdown text files.
- The Camera class, now
H3DU.Camera, was rewritten. - A build script was included in the repository. This build includes a style checker which is run on the library's JavaScript files.
- Many methods were added to many classes. Some methods that didn't return a value now return the value of the object called on, for example, the
clearmethod ofH3DU.Scene3D. - New demos, including spinbox.html and quatlerp.html. For example, the gears.html demo was moved from the separate "html-gears" repository to here. Other demos were expanded or rewritten. Viewport
metatags were added to the demos. - The underlying code used in
H3DU.toGLColorwas rewritten. In particular, the "#RRGGBBAA" format is now supported. - The JavaScript source code better conforms to a uniform code style.
- The experimental 2D canvas renderer in surfaces2d.html, was abandoned.
- Added
disposemethod toH3DU.Scene3D. - Added
createPointedStarandcreateLathemethods toH3DU.Meshes. - Added
getBoundsandtoLinePathmethods toH3DU.GraphicsPath, an extra, as well
as an extra that adds methods that compute the intersection, difference, union, and XOR of two
polygons. Path triangulation now supports polygons with holes. - The default light configuration is no lights when creating a
H3DU.LightSource. The exception, for compatibility purposes, is when using aH3DU.Scene3Dwithout rendering a customBatch3D, in which case the default is one light source with its default values. - The default value for specular materials (
H3DU.Material) is now (0.1, 0.1, 0.1). The default value for shininess is now 32. - The Mesh class no longer supports multiple primitive types (lines, triangles, points). Using different modes that use the same primitive type (for example, TRIANGLE_FAN and QUAD_STRIP) in the same mesh is still supported.
- Many of the tutorials were edited heavily to accommodate the new version. The
GraphicsPathtutorial was added. - There were also numerous bug fixes.
- A known issue: When using the
H3DU.Camerain conjunction with the compatibility behavior ofH3DU.Scene3D, only one side of the scene will appear lighted by default.