... | @@ -4,71 +4,7 @@ |
... | @@ -4,71 +4,7 @@ |
|
|
|
|
|
## Developer's notes
|
|
## Developer's notes
|
|
|
|
|
|
* Improve the input parameter : not a html page but a configuration file that contains current settings.
|
|
To be filled.
|
|
* Add the visibility of components.
|
|
|
|
See https://threejs.org/examples/?q=outline#webgl_postprocessing_outline
|
|
|
|
* Ground : should be visible or not.
|
|
|
|
* Warning with the Three.js implementation that requires to force needsUpdate:
|
|
|
|
ex: this.material.needsUpdate = true;
|
|
|
|
Without the call, the change of material would not be applied.
|
|
|
|
* To add textures, we need another file format because STL does not support texture coordinates. Is there a Javascript loader for OBJ?
|
|
|
|
* Scan 3D models will be inserted into the scene. The instrument Salsa has bought a scanner.
|
|
|
|
|
|
|
|
## Transforms, axis
|
|
|
|
|
|
|
|
The model is loaded and animated by the following pseudo-code:
|
|
|
|
|
|
|
|
<pre>
|
|
|
|
Nomad3DController.move(delta)
|
|
|
|
|
|
|
|
// Rotation is made in the axis frame.
|
|
|
|
localToPivot = translation(-axis.position.x, -axis.position.y, -axis.position.z)
|
|
|
|
rotation = rotation(axis.direction, delta)
|
|
|
|
|
|
|
|
component.sceneNode.apply(localToPivot)
|
|
|
|
component.sceneNode.apply(rotation)
|
|
|
|
component.sceneNode.apply(localToPivot^-1)
|
|
|
|
|
|
|
|
Component.update
|
|
|
|
controller.update()
|
|
|
|
|
|
|
|
for all child : children
|
|
|
|
child.update()
|
|
|
|
|
|
|
|
Component.showConfiguration(config, parentTransform)
|
|
|
|
transform = config.transformMatrix()
|
|
|
|
localTransform = transform
|
|
|
|
inverseParent = parentTransform^-1
|
|
|
|
localTransform.premultiply(inverseParent)
|
|
|
|
sceneNode.matrix.identity()
|
|
|
|
sceneNode.applyMatrix(localTransform);
|
|
|
|
|
|
|
|
for all child : children
|
|
|
|
child.showConfiguration(config, transform)
|
|
|
|
|
|
|
|
Model.update
|
|
|
|
root.update()
|
|
|
|
|
|
|
|
Model.showConfiguration(config)
|
|
|
|
root.showConfiguration(config)
|
|
|
|
|
|
|
|
Importer.read
|
|
|
|
model.update
|
|
|
|
model.showConfiguration("median")
|
|
|
|
|
|
|
|
</pre>
|
|
|
|
|
|
|
|
The main idea is to initialise the model positions by the median configuration and then move it by delta positions.
|
|
|
|
However the _Controller.move()_ function is using the axis position and direction with a change of frame that seems strange.
|
|
|
|
|
|
|
|
## Video demo
|
|
|
|
|
|
|
|
To run the Viewer in demo mode, i.e. animating the model by reading a log file:
|
|
|
|
* In the file init.js, uncomment the two lines concerning Log animator (lines 137 - 140).
|
|
|
|
* The Log animator will then read the file sample.log.
|
|
|
|
* The content of the file sample.log must have been produced by Nomad, using an AxisRecorder controller in InstrumentConfig.xml.
|
|
|
|
* The AxisRecorder controllers produces a file axis.log in the serverlog directory.
|
|
|
|
* Do not set the Reflection and Dynamic Shadows for the video, because the model has colors that are too close from the environment.
|
|
|
|
|
|
|
|
## Environment map
|
|
## Environment map
|
|
|
|
|
... | @@ -82,7 +18,6 @@ The script comes from the site [aerotwist.com](https://aerotwist.com/tutorials/c |
... | @@ -82,7 +18,6 @@ The script comes from the site [aerotwist.com](https://aerotwist.com/tutorials/c |
|
## Ideas
|
|
## Ideas
|
|
|
|
|
|
The ideas are welcome. Here are some:
|
|
The ideas are welcome. Here are some:
|
|
* Show the axes with tooltips.
|
|
|
|
* Automatic zoom on interesting parts.
|
|
* Automatic zoom on interesting parts.
|
|
* Draw the neutron beam.
|
|
* Draw the neutron beam.
|
|
|
|
|
... | | ... | |