Going the Distance with Babylon.js by Josh Elster
Author:Josh Elster
Language: eng
Format: epub, pdf
Publisher: Packt
Published: 2022-12-15T00:00:00+00:00
Figure 8.6 â The Alien.gltf model. The Scene Inspector window shows the __root__ transform node. From https://playground.babylonjs.com/#8IMNBM#1
The Alien geometry is what weâre interested in working with, but because it is parented to the __root__ node, any changes to the position, rotation, or scaling of Alien are evaluated in a coordinate space relative to that root node, resulting in undesired and unpredictable results. The solution to this is simple and answers our earlier question regarding what was up with our loadAssets code â unparent the desired mesh and dispose of the root. Once thatâs accomplished, the rest of the code in our truck loading method is all housekeeping setup for the model â with some important considerations to keep in mind:
Order of operations is important, but not in the way you might think. Changes to a TransformNode (which Mesh is a descendent of) over a given frame are applied in the fixed order of Transform, Rotate, Scale (TRS).
Use setParent(null) rather than the alternative of setting mesh.parent = null. The setParent function preserves positional and rotational values, whereas setting the parent to null does not. This results in any root transformations being removed from the mesh, which is why we need to reset the position and rotation vectors.
Once the transformations have been cleared and the scaling has been set to world-appropriate values, the mesh geometry will need to have new bounding information generated. Otherwise, collisions wonât work properly. The solution to this is the two-step process of calling mesh.bakeCurrentTransformIntoVertices() before calling mesh.refreshBoundingInfo().
Download
Going the Distance with Babylon.js by Josh Elster.pdf
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
3D Graphics | 3D Printing |
Adobe | CAD |
Computer Modelling | Desktop Publishing |
Electronic Documents | Rendering & Ray Tracing |
User Experience & Usability |
Sass and Compass in Action by Wynn Netherland Nathan Weizenbaum Chris Eppstein Brandon Mathis(7414)
Hands-On Unity 2022 Game Development by Nicolas Alejandro Borromeo(2597)
Drawing Shortcuts: Developing Quick Drawing Skills Using Today's Technology by Leggitt Jim(2537)
Autodesk Civil 3D 2024 from Start to Finish by Stephen Walz Tony Sabat(2485)
Mathematics for Game Programming and Computer Graphics by Penny de Byl(2392)
The 46 Rules of Genius: An Innovator's Guide to Creativity (Voices That Matter) by Marty Neumeier(2321)
Rapid Viz: A New Method for the Rapid Visualization of Ideas by Kurt Hanks & Larry Belliston(2207)
Learn Qt 5: Build modern, responsive cross-platform desktop applications with Qt, C++, and QML by Nicholas Sherriff(2185)
Taking Blender to the Next Level by Ruan Lotter(2060)
Express Your Creativity with Adobe Express by Rosie Sue(2042)
Fusion 360 for Makers by Lydia Sloan Cline(1993)
Hands-On Neural Networks with Keras by Niloy Purkait(1915)
Mastering GUI Programming with Python by Alan D. Moore(1778)
Game Physics Cookbook by Gabor Szauer(1580)
Creative Character Design by Bryan Tillman(1565)
Hands-On Unity 2022 Game Development - Third Edition by Nicolas Alejandro Borromeo(1551)
Unreal Engine 4 Game Development Quick Start Guide by Rachel Cordone(1448)
Hands-On GUI Application Development in Go by Andrew Williams(1446)
Qt 5 and OpenCV 4 Computer Vision Projects by Zhuo Qingliang(1427)