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

Add label primitive #25

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,7 @@ Axis
tickScale: 10, // Integer denoting the base for recursive division. 2 = binary, 10 = decimal
arrow: true, // Whether to include an arrow on the axis
size: .07, // Size of the arrow relative to the stage
formatter: null // Function which takes index of axis label as argument, and returns text label
})
```

Expand Down Expand Up @@ -422,6 +423,17 @@ Grid
})
```

Label
```javascript
.label({
position: [0, 0, 0], // location of label
text: 'hello', // text to be displayed
distance: 15, // text sprite anchor point offset
facing: 1, // which axis tangent direction the label should be facing towards
class_name: 'math' // css class name to use for the labels (leave unset for default 'mathbox-labels')
})
```

Surface
```javascript
.surface({
Expand Down Expand Up @@ -455,6 +467,13 @@ Vector
})
```

Dependencies
------------

* vendor/ThreeBox.js -- https://github.com/unconed/ThreeBox.js (use commit tag ff838075a7bea4ba59719f845f466b9c4b2cbafe)
* vendor/ThreeRTT.js -- https://github.com/unconed/ThreeRTT.js
* vendor/ShaderGraph.js -- https://github.com/unconed/ShaderGraph.js

Contributions
-------------

Expand Down
1 change: 1 addition & 0 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ src/primitives/Vector.js
src/primitives/Surface.js
src/primitives/BezierSurface.js
src/primitives/Platonic.js
src/primitives/Label.js

src/renderables/Renderable.js
src/renderables/Mesh.js
Expand Down
Loading