Skip to content

Version 2.0.0-beta1

Pre-release
Pre-release
Compare
Choose a tag to compare
@peteroupc peteroupc released this 04 Jan 18:32
· 294 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, Shape is now H3DU.Shape and Mesh is now H3DU.Mesh. Many classes in the "extras" directory are also moved to the H3DU namespace.
  • Scene3D, now H3DU.Scene3D, is no longer meant to be a scene graph of objects to draw. That job now belongs to the new H3DU.Batch3D class. Scene3D's render method now takes an array of Batch3Ds to render. For compatibility, though, the methods allowing it to manage 3D models and the coordinate system, such as makeShape and setPerspective, can still be used until H3DU.Scene3D renders a custom H3DU.Batch3D. This compatibility behavior may be dropped in the future.
  • Alpha is disabled in WebGL contexts created with the H3DU.get3DOr2DContext method.
  • The Scene3D H3DU.Scene3D#useProgram method was deprecated and now does nothing.
  • New H3DU.RenderPass3D class holds information about how a batch of 3D models is to be rendered. It replaces the Scene3D H3DU.Scene3D#useFilter method, which now does nothing.
  • New H3DU.FrameBufferInfo class holds information about a frame buffer; it replaces H3DU.FrameBuffer.
  • The BufferedMesh, FrameBuffer, and ShaderProgram classes are deprecated because they are too tightly coupled with a particular WebGL context. Instead, use H3DU.MeshBuffer, H3DU.FrameBufferInfo, and H3DU.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.Shape object is no longer coupled to vertex buffers.
  • The H3DU.LightSource class now supports a radius of the light.
  • The H3DU.TextureLoader class was added for loading textures; a single object of this class can load and upload images from multiple WebGL contexts. This is unlike BufferedMesh, FrameBuffer, and ShaderProgram, which are tied to the WebGL context.
  • GLMath, now H3DU.Math, was expanded with many new methods. The documentation for it is now very detailed. New methods include H3DU.Math.vec3perp, H3DU.Math.vec3toWindowPoint, and H3DU.Math.mat4projectVec3.
  • Two new classes in the "extras" folder support 2D text rendering and texture atlases (as sprite sheets), namely, H3DU.TextFont and H3DU.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 clear method of H3DU.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 meta tags were added to the demos.
  • The underlying code used in H3DU.toGLColor was 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 dispose method to H3DU.Scene3D.
  • Added createPointedStar and createLathe methods to H3DU.Meshes.
  • Added getBounds and toLinePath methods to H3DU.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 a H3DU.Scene3D without rendering a custom Batch3D, 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 GraphicsPath tutorial was added.
  • There were also numerous bug fixes.
  • A known issue: When using the H3DU.Camera in conjunction with the compatibility behavior of H3DU.Scene3D, only one side of the scene will appear lighted by default.