Graphics handling in kBridge has three.js as the standard graphics target.
"Modeling" of kBridge entities in three.js is explicit. It is possible to control whether a model is created in three.js using the modelNode parameter. If false, no model is created, and many other operations do nothing (such as trying to render it). By default, the update cycle will both model and render. Things which have geometry but are not rendered still contribute to bounding boxes [still being debated].
The assembly hierarchy modeled in three.js exactly as it exists in the rule engine. Every model in the model tree has a representation in the three.js scene graph, including "group" levels. There is a one-to-one correspondence between unique reference chains and nodes in the scene graph.
A model’s transform is the Frame for the model relative to the world coordinate system. The localTransform is the Frame for the model relative to its parent.
BaseAssembly supports positioning (via FrameMixin) and three.js modeling and rendering (via AssemblyRenderMixin and Render3Mixin). Use BaseNode for a simple assembly which should not be modeled in three.js and doesn’t need to support geometry.
Rule |
Flag |
Description |
Color: |
String |
Defines the color/material used to render this object. |
renderNode: |
Boolean |
If true, causes this object to be shown in the graphics scene. The default is this.modelNode && this.parent.renderChildren. |
modelNode: |
Boolean |
If true, causes this object to be modeled in the graphics scene. The default is (this.children.length <= 0). |
renderChildren: |
Boolean, Lookup |
If true, allows the children of this object to be shown in the graphics scene. The default is (this.children.length > 0). Note that the children are still only rendered if their renderNode value is true. |
sceneName: |
String, Lookup |
The name of the scene which should receive this object. Default is "model". [Future use] |
Rule |
Flag |
Desciption |
update3: |
Boolean |
This is the primary driver of the update cycle. It calls both model3Node and render3Node. The value is not particularly useful. |
model3Node: |
Boolean |
This causes the model to be created and positioned in the scene. The value represents only positioning success. |
render3Node: |
String |
This causes this object to be shown in the graphics scene. |
renderName: |
String |
This is the name by which this object is known in the graphics scene, and what will be returned when selected. It is currently the refChain. |
bbox: |
BBox |
Returns the bounding box which contains this object and all of its children. [incomplete in 0.12.4] |
Source: JGG 1 May 2019