From 883e660e7cad28d0a0937a1b0d969e3d3f3b4c20 Mon Sep 17 00:00:00 2001 From: Aaron Fenyes Date: Mon, 21 Oct 2024 16:31:15 -0700 Subject: [PATCH] Put each script block next to the associated board div --- templates/circle-sampler.html | 1 + templates/glider-sampler.html | 50 +++++++++++---------- templates/intersection-sampler.html | 26 ++++++----- templates/polygon-sampler.html | 31 +++++++------ templates/sphere-sampler.html | 15 ++++--- templates/view-demo.html | 67 +++++++++++++++-------------- 6 files changed, 106 insertions(+), 84 deletions(-) diff --git a/templates/circle-sampler.html b/templates/circle-sampler.html index d0a5e12..958469e 100644 --- a/templates/circle-sampler.html +++ b/templates/circle-sampler.html @@ -72,5 +72,6 @@ ); } + diff --git a/templates/glider-sampler.html b/templates/glider-sampler.html index 868e79f..4b8d005 100644 --- a/templates/glider-sampler.html +++ b/templates/glider-sampler.html @@ -10,28 +10,12 @@

3D glider sampler

+ +

Line glider

The large point is a glider on the line segment defined by the two small points. This template is based on the Line3D glider example in the examples folder included with the source code.

-

Intersection line glider

-

The large point is a glider on the line where the two planes intersect.

-
- -

Circle glider

-

The point is a glider on the circle. This template is based on the Circle3D glider example in the examples folder included with the source code.

-

Right now, the glider gets caught on the point where the circle starts and ends. If you can overcome this limitation, try contributing some code!

-
- -

Curve glider

-

The point is a glider on the curve. This template is based on the Curve3D glider example in the examples folder included with the source code.

-
- -

Parametric surface glider

-

The point is a glider on the parametric surface. This template is based on the ParametricSurface3D glider example in the examples folder included with the source code.

-
- - + +

Intersection line glider

+

The large point is a glider on the line where the two planes intersect.

+
+ + +

Circle glider

+

The point is a glider on the circle. This template is based on the Circle3D glider example in the examples folder included with the source code.

+

Right now, the glider gets caught on the point where the circle starts and ends. If you can overcome this limitation, try contributing some code!

+
+ + +

Curve glider

+

The point is a glider on the curve. This template is based on the Curve3D glider example in the examples folder included with the source code.

+
+ + +

Parametric surface glider

+

The point is a glider on the parametric surface. This template is based on the ParametricSurface3D glider example in the examples folder included with the source code.

+
+ + diff --git a/templates/intersection-sampler.html b/templates/intersection-sampler.html index f99022f..930c31b 100644 --- a/templates/intersection-sampler.html +++ b/templates/intersection-sampler.html @@ -10,19 +10,12 @@

3D intersection sampler

+ +

Plane–plane

This template is based on the plane–plane intersection example in the examples folder included with the source code.

-

Plane–sphere

-

This template is based on the plane–sphere intersection example in the examples folder included with the source code.

-
- -

Sphere–sphere

-

This template is based on the sphere–sphere intersection example in the examples folder included with the source code.

-
- - + +

Plane–sphere

+

This template is based on the plane–sphere intersection example in the examples folder included with the source code.

+
+ + +

Sphere–sphere

+

This template is based on the sphere–sphere intersection example in the examples folder included with the source code.

+
+ + diff --git a/templates/polygon-sampler.html b/templates/polygon-sampler.html index b84fe09..3d224b1 100644 --- a/templates/polygon-sampler.html +++ b/templates/polygon-sampler.html @@ -10,24 +10,13 @@

3D polygon sampler

+ +

Creating a polygon

A polygon is created from a list of vertices. Each vertex is given either in coordinates or as a Point3D element. The vertices that are created from coordinates are styled according to the vertices attribute. The edges of the polygon are styled according to the borders attribute.

To make the layout of the vertices easier to see, I’ve set the view’s depthOrderPoints attribute to true.

-

Mixing coordinates and Point3D elements

-

This example shows how you can mix coordinates and Point3D elements in a polygon’s vertex list.

-
- -

Filling a polygon

-

You can set the fill and opacity of a 3D polygon just like you would with a 2D polygon. I recommend only filling polygons that are guaranteed to stay planar. In this example, the polygons are always planar because they’re triangles.

-
- -

The pitalls of filling a non-planar polygon

-

Make the polygon below non-planar by dragging its vertices. This will probably make the fill look really weird from certain angles.

-
- - + +

Mixing coordinates and Point3D elements

+

This example shows how you can mix coordinates and Point3D elements in a polygon’s vertex list.

+
+ + +

Filling a polygon

+

You can set the fill and opacity of a 3D polygon just like you would with a 2D polygon. I recommend only filling polygons that are guaranteed to stay planar. In this example, the polygons are always planar because they’re triangles.

+
+ + +

The pitalls of filling a non-planar polygon

+

Make the polygon below non-planar by dragging its vertices. This will probably make the fill look really weird from certain angles.

+
+ + diff --git a/templates/sphere-sampler.html b/templates/sphere-sampler.html index 3d41541..1ddc916 100644 --- a/templates/sphere-sampler.html +++ b/templates/sphere-sampler.html @@ -10,6 +10,8 @@

Sphere sampler

+ +

Creating spheres

Right now, there are two ways to create a Sphere3D: @@ -21,11 +23,6 @@

-

Styling spheres

-

Here are some styling options for spheres and the points that define them.

-
- - - + + +

Styling spheres

+

Here are some styling options for spheres and the points that define them.

+
+ + diff --git a/templates/view-demo.html b/templates/view-demo.html index 053f7bb..a17669f 100644 --- a/templates/view-demo.html +++ b/templates/view-demo.html @@ -10,6 +10,8 @@

View options demo

+ +

Central projection; depth ordering for points

This demo shows how the new projection and depthOrderPoints options of a View3D affect the view. Use the controls to: @@ -32,38 +34,6 @@

-

Virtual trackball; bank angle slider

-

- In the default orientation control mode, dragging the mouse changes the Tait-Bryan angles of the camera. -

- The Tait-Bryan angles can also be controlled with sliders, which are hidden by default. To show them, set the following attributes: - -

-

- Version 1.9.2 introduces a new orientation control mode: the virtual trackball. In this mode, dragging from near the center of the board rolls the view along the drag direction, while dragging from near the edge of the board rotates the view in the plane of the board. These two motions transition smoothly into each other as the drag start position changes. To enable the virtual trackball, set the trackball attribute of the View3D to {enabled: true}. -

-

- This demo is based on the virtual trackball example in the examples folder included with the source code. -

-

-
- - -
-
- - + +

Virtual trackball; bank angle slider

+

+ In the default orientation control mode, dragging the mouse changes the Tait-Bryan angles of the camera. +

+ The Tait-Bryan angles can also be controlled with sliders, which are hidden by default. To show them, set the following attributes: + +

+

+ Version 1.9.2 introduces a new orientation control mode: the virtual trackball. In this mode, dragging from near the center of the board rolls the view along the drag direction, while dragging from near the edge of the board rotates the view in the plane of the board. These two motions transition smoothly into each other as the drag start position changes. To enable the virtual trackball, set the trackball attribute of the View3D to {enabled: true}. +

+

+ This demo is based on the virtual trackball example in the examples folder included with the source code. +

+

+
+ + +
+
+ +