-
Notifications
You must be signed in to change notification settings - Fork 25
Migrate to XML3D 5.0
The 5.0 release of XML3D is not backwards compatible to 4.x. Here is a list of changes you have to apply to your scene to migrate to version 5.0:
activeview, fieldofview, wraps, wrapt, wrapu, filtermin, filtermax, filtermip, scaleorientation
- You can still use
getAttributeandsetAttributewith camel-cased names (eg. setAttribute("fieldOfView", 0.5) ). These will automatically be lowercased in XML3D 5.0 - Element properties (eg. viewElement.fieldOfView) are still camel-cased.
getBoundingBox() is no longer available on xml3d, group, mesh and model elements. There are now two separate functions available:
- getLocalBoundingBox() - Get the bounding box of the element in object space
- getWorldBoundingBox() - Get the bounding box of the element in world space (including all parent transformations).
If you are using getBoundingBox() now you should choose one of the two new functions instead, depending on what kind of bounding box you need.
This attribute was renamed for clarity. Like before it should contain a URI to a <data> element with a <float4x4> value element named "projection". The supplied matrix will replace the camera's projection matrix.
The definition of lights has changed in XML3D 5.0 (see this issue). The simplest way migrating is to
- Move the value of the lightshader's
scriptattribute to the lightsmodelattribute (specifying the light model) - Rename
urn:xml3d:lightshader:xxxtourn:xml3d:light:xxxin the light model defintion - Rename the
<lightshader>element to<data> - Rename the light's
shaderattribute tosrc
The texture attributes to configure the texture sampling were not HTML5 compliant and thus we changed the names and merged some of them:
-
warpSandwrapThave been merged towrap. Specify the wrap type (clamp, repeat) for s and t direction in order or just one value for the same wrap type in all directions -
filterMinandfilerMaghave been merged tofilter. Specify the filtering first for minification then for magnification (e.g.filter="linear-mipmap-linear linear").
Voilà!