- This topic has 3 replies, 2 voices, and was last updated 8 years, 3 months ago by .
Viewing 4 posts - 1 through 4 (of 4 total)
Viewing 4 posts - 1 through 4 (of 4 total)
- You must be logged in to reply to this topic.
Home › Forum › SOFA › Using SOFA › [SOLVED] Visualisation of 2D scenes in SOFA
Tagged: 64_bits, SOFA_1608, Windows_81
Hi all,
I have a 2D scene (template=Vec2d) which consists of a static triangular mesh and scalar field defined on top of that mesh.
I wish to visualize the scalar field using OglModel and a texture component.
The classical approach is to create a node with an Identity mapping and an OglModel (and a texture component). However, there seems to be an issue as the OglModel seems to be only fed with 3d position fields and the IdentityMapping cannot map 2D position vectors into 3D position vectors.
Do you have any idea, how to get around that ?
One option would be to have an IdentityMapping that maps 2D positions (Vec2d) into 3D positions (ExtVec3f) but this create some issues (filling the missing dimension with 0).
Thanks.
Hervé
Hi Hervé !!
I think what you need for the visualization is :
Like:
<Node name="Visu">
<DataDisplay pointData="@../dist.distance" />
<ColorMap colorScheme="Blue to Red" />
<IdentityMapping /> <!-- (with the Vec3d MO) -->
</Node>
</Node>
To display colors based on any scalar data, you can use any the ColorMap component: see examples/Components/visualmodel/DataDisplay.scn
Let us know if this suits what you want.
Cheers,
Hugo
Thanks Hugo.
Precisely the issue is that there is no IdentityMapping instanciated between a Vec2D and a ExtVec3f.
The IdentityMapping are instanciated between types of the same size 2d->2f or Vec3d ->ExtVec3f
and I am not sure it would work with types of different sizes.
Any thoughts ?
Hervé
Hervé,
Can you share with us an example of your scene so that I can try a workaround?
Cheers,
Hugo
WARNING
The forum has been moved to GitHub Discussions.
Old topics and replies are kept here as an archive.