Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plugins API for X3DOM #618

Open
wants to merge 22 commits into
base: master
Choose a base branch
from

Conversation

YuanxiangFranck
Copy link
Contributor

During my internship, I worked on the creation of x3dom-based tools
for mesh data visualization and analysis. I wanted to create new DOM
nodes that integrate nicely in a standard x3dom tree, namely
iso-color, threshold, clip-plane.

I had two goals in mind:

  1. create an x3dom plugin API that allows one to create new DOM nodes
    which extend x3dom functionality;
  2. keep a simple x3dom-like interface for the final users.

In this branch I created a new node : CustomAttributeNode. This node
serve as entry point in x3dom to use the API.

For a detailed technical explanation of the API take a look at the GitHub
repository
of
my demonstration.

Example of the API:

Following example illustrates the usage of such plugins. The relevant
markup looks like:

<TriangleSet>
  <Coordinate point="..."> </Coordinate>
  <Normal vector="..."> </Normal>
  <Threshold
     upperBound="1" lowerBound="0" dataName="triSetData" > </Threshold>
  <IsoColor
     max="1" min="0" dataName="triSetData" > </IsoColor>
  <FloatVertexAttribute
     name="triSetData" numComponents="1" value="..."> </FloatVertexAttribute>
  <FloatVertexAttribute
     name="other_set_of_data" numComponents="1" value="..."> </FloatVertexAttribute>
  ...
</TriangleSet>

The Threshold and IsoColor nodes work like any x3dom node:
they react to any attribute change using DOM's node setAttribute
method. This makes it easy to use HTML widgets like sliders / buttons
to drive the plugin's parameters.

Example and live demonstration on:
http://yuanxiangfranck.github.io/x3dom-plugins-API/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant