Magnetic lines

From H3D.org

Jump to: navigation, search

This example shows the use of MagneticSurface.

Image:Note-tip.pngThis tutorial refers to the source code. You can download it from SVN at H3D release branch, or find it at H3D/H3DAPI/examples/magneticlines.
 
<!!-- magneticlines.x3d -->
<Group>
  <Shape>
    <Appearance>
      <Material emissiveColor="1 0 0"/>
      <MagneticSurface />
    </Appearance>
    <LineSet vertexCount="4">
      <Coordinate point="0.1 0.1 0, 0.1 -0.1 0, -0.1 -0.1 0, -0.1 0.1 0"/>
      <HapticsOptions maxDistance="0.15" />
    </LineSet>
  </Shape>
</Group>
 

We create a Shape with LineSet to model the lines in our program. To simulate magnetic lines, we merely add the MagneticSurface node in Appearance.

References

Personal tools
go to