Functions | |
void | AddFrameOrigin (scalar x, scalar y, scalar z) |
Adds a vector to the current origin of the drawing frame. | |
void | AddFrameRotor (multivector R) |
Adds a rotation to the drawing frame. | |
color | Color (scalar r, scalar g, scalar b, scalar a) |
Generate a color variable. | |
color | Color (scalar r, scalar g, scalar b) |
Generate a color variable. | |
void | DrawArc (multivector P, multivector A, multivector B, scalar Rad, counter Short) |
Draws an arc. | |
void | DrawArrow (scalar ax, scalar ay, scalar az, scalar bx, scalar by, scalar bz) |
Draws an arrow. | |
void | DrawArrow (multivector A, multivector B) |
Draws an arrow. | |
void | DrawBox (multivector P, multivector A, multivector B, scalar Depth, list CornerColorList) |
Draws a box. | |
void | DrawBox (multivector P, multivector A, multivector B, multivector C, list CornerColorList) |
Draws a box. | |
void | DrawCircle (multivector P, multivector N, scalar Rad) |
Draws a circle. | |
vertexlist | DrawCircleSurface (list LMV, list LCol, counter DoDraw) |
Draws the surface spanned by a set of circles. | |
void | DrawCone (multivector P, multivector A, scalar Rad) |
Draws a cone. | |
vertexlist | DrawCylinder (multivector P, multivector D, scalar Radius, counter DoDraw) |
Draws an open cylinder. | |
void | DrawDisk (multivector P, multivector A, multivector B, scalar Rad, counter Short) |
Draws a partial disk. | |
void | DrawEllipse (multivector P, multivector A, multivector B) |
Draws an ellipse. | |
void | DrawEllipsoid (multivector P, multivector A, multivector B, multivector C) |
Draws an ellipsoid. | |
void | DrawIcosahedron (multivector vC, scalar dRadius, counter iPower, counter bSolid) |
Draws an icosahedron. | |
void | DrawLine (scalar ax, scalar ay, scalar az, scalar bx, scalar by, scalar bz) |
Draws a line. | |
void | DrawLine (multivector A, multivector B) |
Draws a line. | |
vertexlist | DrawLineSurface (list LMV, list LCol, counter DoDraw) |
Draws the surface spanned by a set of lines. | |
void | DrawPlane (scalar cx, scalar cy, scalar cz, scalar ax, scalar ay, scalar az, scalar bx, scalar by, scalar bz, scalar Rad) |
Draws a plane. | |
void | DrawPlane (multivector C, multivector A, multivector B, scalar Rad) |
Draws a plane. | |
void | DrawPoint (scalar x, scalar y, scalar z) |
Draws a point. | |
void | DrawPoint (multivector A) |
Draws a point. | |
vertexlist | DrawPointGrid (counter CountX, counter CountY, list LMV, list LCol, counter DoDraw, counter NegNormals, list LNorm) |
Draws a surface grid over a 2-dimensional set of points. | |
vertexlist | DrawPointList (list LMV, list LCol, counter DoDraw, counter NegNormals, list LNorm) |
Draws a line through a set of points. | |
vertexlist | DrawPointSurface (counter CountX, counter CountY, list LMV, list LCol, counter DoDraw, counter NegNormals, list LNorm) |
Draws a surface over a 2-dimensional set of points. | |
void | DrawSphere (multivector P, scalar Rad) |
Draws a sphere. | |
void | DrawText (multivector A, string Text) |
Draws a simple text. | |
void | DrawTriangle (multivector A, multivector B, multivector C) |
Draws a triangle. | |
void | DrawTriangle (scalar ax, scalar ay, scalar az, scalar bx, scalar by, scalar bz, scalar cx, scalar cy, scalar cz) |
Draws a triangle. | |
void | EnableAbsTexCoords (counter bVal) |
Enables or disables the use of absolute texture coordinates. | |
void | EnableFog (counter bEnable) |
Enables or disables fog. | |
void | EnableSmoothLine (counter IsSmooth) |
Enables anti-aliasing for lines. | |
void | EnableSmoothPoint (counter IsSmooth) |
Enables anti-aliasing for points. | |
void | EndOverlay (void) |
Ends an overlay block. | |
void | EndView () |
Exit the actual view. | |
counter | GetLineWidth () |
Returns the width of lines. | |
counter | GetPointSize () |
Returns the size of points. | |
void | Offset (multivector A, multivector X, scalar scale) |
This function draw multivector A at the offset given by multivector X and scaled to scale. Use this function, for example, to draw plane or lines at particular positions. | |
vertexlist | Plot (list A, list L1, list L2, scalar S) |
Draw a point-valued 2D-function, i.e. a surface, with associated colors and normals. | |
vertexlist | Plot (list A, list L) |
Draw a point-, circle- or line-valued 1D-function with varying colors. | |
vertexlist | Plot (multivector F, list L1, list L2, scalar S) |
Draw a point-valued 2D-function, i.e. a surface. | |
vertexlist | Plot (multivector F, list L) |
Draw a point-, circle- or line-valued 1D-function. | |
void | PopFrame (void) |
Restore saved projection matrix from the stack. | |
void | PushFrame (void) |
Save current projection matrix to a stack. | |
void | RotateFrame (multivector R) |
Rotates the drawing frame. | |
void | RotateView (multivector R) |
Rotates the projectview matrix of OpenGl. | |
void | SetArrowShape (scalar dLength, scalar dAngle) |
Sets the shape in which arrows are drawn. | |
void | SetFogColor (color colFog) |
Sets the color of fog. | |
void | SetFogDensity (scalar dDensity) |
Set the density of fog. | |
void | SetFrameOrigin (scalar x, scalar y, scalar z) |
Sets the origin of the drawing frame. | |
void | SetFrameRotor (multivector R) |
Sets the rotation of the drawing frame. | |
void | SetLineWidth (scalar Width) |
Sets the width of lines in pixel. | |
void | SetMode (counter mode) |
Sets one or a number of drawing modes. | |
void | SetPlotMode (counter mode) |
Sets the plot mode for the function Plot(). | |
void | SetPointSize (scalar Size) |
Sets the size of points in pixel. | |
void | SetTextSize (counter Size) |
Sets the size of text drawn with DrawText(). | |
void | SetTexture (image Img) |
Sets the texture for texture mapping, or disables texture mapping. | |
void | SetTextureRepeat (scalar dFac) |
Sets the texture repetition factor. | |
void | SetViewAngle (scalar a) |
Set the perspective angle which affects the modelview. | |
void | SetVisWinSize (counter iWidth, counter iHeight) |
Set the size of the visualization window. | |
void | StartOverlay (void) |
Starts an overlay block. | |
void | StartView (scalar x, scalar y, scalar w, scalar h) |
Start a new view. | |
void | TranslateFrame (multivector T) |
Translates the drawing frame. | |
void | TranslateFrame (scalar x, scalar y, scalar z) |
Translates the drawing frame. | |
void | TranslateView (multivector T) |
Translate the projectview matrix of OpenGl. | |
void | TranslateView (scalar x, scalar y, scalar z) |
Translate the projectview matrix of OpenGl. |
|
Adds a vector to the current origin of the drawing frame.
|
|
Adds a rotation to the drawing frame.
|
|
Generate a color variable.
Color1.clu for a nice example. The last parameter (the alpha component) gives the translucency of an object. If alpha is one, then the object is completely opaque. If alpha is zero, then the object is completely transparent. |
|
Generate a color variable.
Color1.clu for a nice example.For example, produces the output MyCol = (0.1, 0.4, 0.6) |
|
Draws an arc.
DefVarsE3(); :Green; :P = e2; :Red; :A = e1 + e2; :Blue; :B = e3 + e2; :Magenta; DrawArc(P, A, B, 1); :Cyan; DrawArc(P, A, B, 1, 0); This script generates the following image.
![]() |
|
Draws an arrow.
|
|
Draws an arrow.
|
|
Draws a box.
|
|
Draws a box.
DefVarsE3(); lCol = [ Red, Magenta, Blue, Cyan, Green, Yellow, White, DWhite ]; DrawBox(id, e1, e2, e3, lCol); produces the visualization
![]() |
|
Draws a circle.
|
|
Draws the surface spanned by a set of circles.
KleinBottle.clu which draws a Klein bottle.
// Switch on anti-aliasing for lines EnableSmoothLine(1); // Define the standard basis vector variables // for conformal space. DefVarsN3(); // Do not show the frame box _FrameBoxSize = 0; // Define three spheres S1 = SphereN3(0,0,0, 1); S2 = SphereN3(0.1,0.5,0, 1); S3 = SphereN3(0.2,0.7,0, 1); // Draw all spheres with a solid surface :N3_SOLID; // Use a transparent color :Color(0.198, 0.264, 1.000, 0.8); // Draw a fourth sphere, whose x-position // can also be influenced by the user in // mouse mode one with the right // mouse button. :S4 = SphereN3(Mouse(1,2,1),0.8,0, 1); // Set the color to red :Red; // Intersect spheres 1 and 2, and // draw intersection circle :C1 = *S1 . S2; // Set Color to green :Green; // Intersect spheres 2 and 3, and // draw intersection circle // If you remove the minus sign in this equation, // you obtain a completely different surface. :C2 = -*S2 . S3; // Set Color to magenta :Magenta; // Intersect spheres 3 and 4, and // draw intersection circle :C3 = *S3 . S4; // Create a list of circles LCircle = [C1, C2, C3]; // Create a list of colors LColor = [Red, Green, Magenta]; // Draw surface spanned by circles. DrawCircleSurface(LCircle, LColor); This script generates the following visualization.
![]()
If you change the line
![]() |
|
Draws a cone.
|
|
Draws an open cylinder.
_BGColor = White; d = 1.1; D = VecN3(0,0.5,0); DrawCylinder( VecN3( -2*d,0,0 ), D, 1 ):Blue; DrawCylinder( VecN3( 0,0,0 ), D, 1 ):Black; DrawCylinder( VecN3( 2*d,0,0 ), D, 1 ):Red; DrawCylinder( VecN3( -d,0,-d ), D, 1 ):Yellow; DrawCylinder( VecN3( d,0,-d ), D, 1 ):Green; that produces a kind of olympic 'cylinders'.
![]() |
|
Draws a partial disk.
|
|
Draws an ellipse.
|
|
Draws an ellipsoid.
|
|
Draws an icosahedron.
DrawIcosahedron(VecE3(0,0,0), 1, 3, false); Output:
![]() |
|
Draws a line.
|
|
Draws a line.
|
|
Draws the surface spanned by a set of lines.
DrawCircleSurface . The code
DefVarsN3(); :IPNS; _FrameBoxSize = 0; // Define a line and a transformation (mvT) mvLine = e^VecN3( 1,0,0) ^ VecN3( 2,0,0 ); mvT = TranslatorN3( 0,0,0.2) * RotorN3( 0,0,1, 7*Pi/180 ); lmvL = []; // declare empty lists for lines and colors lcolC = []; // create a set of lines dNum = 40; i = 0; loop{ if ( i == dNum ) break; i = i + 1; mvLine = mvT * mvLine* ~mvT; lmvL << (mvLine * I); lcolC << Color( 1, pow(i/dNum,2), 0 ); } DrawLineSurface( lmvL, lcolC ); generates for example the following output
![]() |
|
Draws a plane.
|
|
Draws a plane.
|
|
Draws a point.
|
|
Draws a point.
|
|
Draws a surface grid over a 2-dimensional set of points.
DrawPointGrid function each time you want to draw the surface grid.In order to get a surface grid drawn, you first need to generate a list of surface points. They have to be ordered row-wise. That is, the list of points contains first all points of the first row, then the points of the second row, etc. See function DrawPointSurface() for an example. |
|
Draws a line through a set of points.
DrawPointList function each time you want to draw the function.This function can be used to replace the Plot() function. However, you will have to write the loop that generate the points yourself. See function DrawPointSurface() for an example of how to generate such a list. |
|
Draws a surface over a 2-dimensional set of points.
DrawPointSurface function each time you want to draw the surface.
In order to get a surface drawn you first need to generate a list of surface points. They have to be ordered row-wise. That is, the list of points contains first all points of the first row, then the points of the second row, etc. Here is a simple example to draw the function
// Switch off the frame box _FrameBoxSize = 0; // Define the standard basis vector variables // for Euclidean space. DefVarsE3(); // The step width in x and y direction StepX = 0.1; StepY = 0.1; // The Plot range MinX = -1; MaxX = 1; MinY = -1; MaxY = 1; // Count the rows that we draw. RowCount = 0; // Reset lists LP = []; LC = []; LC2 = []; // Set y to initial value y = MinY; // and start a loop over y loop { // Check whether y is out of range if (y > MaxY) break; // if yes, then end loop over y // Set x to its initial value x = MinX; // and start a loop over x loop { // check whether x is out of range if (x > MaxX) break; // if yes, then end loop over x // Evaluate point a current x,y-position A = x*e1 + y*e3 + sin(3*x)*cos(2*y)*e2; // Evaluate color at current position c = exp(-x*x*y*y/0.1); Col = Color(c, 0, 1 - c); // Evaluate color for surface grid c = 0.9 * c; Col2 = Color(c, 0, 1-c); // Add point to list LP << A; // Add color to list LC << Col; // Add color to list LC2 << Col2; // Increase x-position by StepX x = x + StepX; } // Increase y-position by StepY y = y + StepY; // Count the rows RowCount = RowCount + 1; } // Evaluate the columns ColCount = Len(LP) / RowCount; // Draw Surface DrawPointSurface(ColCount, RowCount, LP, LC); // Draw Grid DrawPointGrid(ColCount, RowCount, LP, LC2); This generates the following image. ![]() |
|
Draws a sphere.
|
|
Draws a simple text.
:A = VecE3(1,2,1); :Red; SetTextSize(2); DrawText(A, A); This code produces the following output.
![]() |
|
Draws a triangle.
|
|
Draws a triangle.
|
|
Enables or disables the use of absolute texture coordinates.
|
|
Enables or disables fog.
|
|
Enables anti-aliasing for lines.
|
|
Enables anti-aliasing for points.
|
|
Ends an overlay block.
|
|
Exit the actual view.
StartView . |
|
Returns the width of lines.
|
|
Returns the size of points.
|
|
This function draw multivector A at the offset given by multivector X and scaled to scale. Use this function, for example, to draw plane or lines at particular positions.
|
|
Draw a point-valued 2D-function, i.e. a surface, with associated colors and normals.
F has to be a point-valued function. The resultant (multi-)vectors may be from any space but must have a point representation in Euclidean space. C has to be a color-valued function. It gives the color at each point of the surface. N also has to be point-valued. However, here the point is interpreted as the direction of a normal. These directions need not be normalized, since this is done internally. If no normal function is given, the surface normals are evaluated from the function itself. The normals are used for correct lighting of the surface, as well as drawing the normals if parameter S is given. T also has to be a point valued function, whereby currently only the first two components of the vectors are used. See Texture Mapping for more details on texture coordinates. The texture coordinate function always has to be the fourth element in the list A. Otherwise it could not be distinguished from the normal function. If you do not to want to specify a normal or color function but you do want to specify a texture function, the color and normal function have to be represented by 0 in the list A. For an example see section Arbitrary Surfaces of Texture Mapping. The lists L1 and L2 must contain their respective free variable, minimum value, maximum value and number of partitions into which the given range is split. If the parameter S is given, it sets the length of normals drawn on top of the surface. Negative values are also allowed, in which case the normals are drawn on the back of the surface. If this parameter is not given or set to zero, no normals are drawn. See section Plotting Vector Functions for more details. For example, :Plot([VecE3(y, x*x*y*y, x), // Function Color(x*x, y*y, 1-x*x*y*y), // Color *(VecE3(0,2*x*y*y, 1)^VecE3(1, 2*x*x*y, 0)) // Normal ], [x, -1, 1, 20], [y, -1, 1, 20], 0.1); produces the visualization
![]() |
|
Draw a point-, circle- or line-valued 1D-function with varying colors.
CanalSurf1.clu ' for an example). Similarly, if F is line-valued (e.g. 2-blades in projective space or 3-blades in conformal space), then the surface spanned by the lines is shown.The second element C has to be a color valued function. It gives the color for each parameter value. The list L must contain the free variable, the minimum value, the maximum value and the number of partitions into which the given range is split. If the number of partitions is n then Plot() evaluates the functions F and C, n+1 times. See section Plotting Vector Functions for more details. For example, produces the visualization
![]() |
|
Draw a point-valued 2D-function, i.e. a surface.
The lists L1 and L2 must contain their respective free variable, minimum value, maximum value and number of partitions into which the given range is split. If the parameter S is given, it sets the length of normals drawn on top of the surface. Negative values are also allowed, in which case the normals are drawn on the back of the surface. If this parameter is not given or set to zero, no normals are drawn. See section Plotting Vector Functions for more details. For example, produces the visualization
![]() |
|
Draw a point-, circle- or line-valued 1D-function.
F has to be a point-, circle- or line-valued function. The resultant (multi-)vectors may be from any space but must have a representation in Euclidean space. If F is point-valued, Plot() draws a curve in space. If it is circle-valued (e.g. 3-blades in conformal space), then surface spanned by the circles is drawn (see 'CanalSurf1.clu ' for an example). Similarly, if F is line-valued (e.g. 2-blades in projective space or 3-blades in conformal space), then the surface spanned by the lines is shown. The circle and line surface functionality is available since version 2.1.
The list For example, produces the output SQ = ((0, 0, 0), (0.25, 0.0625, 0), (0.5, 0.25, 0), (0.75, 0.5625, 0), (1, 1, 0)) |
|
Restore saved projection matrix from the stack.
glPopMatrix . All parameters corresponding to the frame will be restored. In case of extensive drawing operations it is often more convenient to change the frame and perform the drawings relative to the new origin instead of adjusting all parameters in all drawing functions. Here's an example, PushFrame(); // save frame TranslateFrame(-2,0,0); DrawCone( VecE3( 0,0,0), VecE3( 0,1,0), 1 ); // Draw cone at current (translated) origin. // more draw operations .... PopFrame(); // restore frame :e0:Red; // Visualize origin.
![]() |
|
Save current projection matrix to a stack.
glPushMatrix . The matrix that contains the actual settings concerning the frame will be pushed to the stack. To restore the matrix and thus the frame use PopFrame . |
|
Rotates the drawing frame.
|
|
Rotates the projectview matrix of OpenGl.
RotateFrame , the openGL camera coordinate system is rotatad, instead of rotating the object coordinate system. Note that only consecutive drawing commands will relate to the new view of the scene. |
|
Sets the shape in which arrows are drawn.
0.15 for the length and 15 for the angle. |
|
Sets the color of fog.
|
|
Set the density of fog.
|
|
Sets the origin of the drawing frame.
|
|
Sets the rotation of the drawing frame.
|
|
Sets the width of lines in pixel.
|
|
Sets one or a number of drawing modes.
|
|
Sets the plot mode for the function Plot().
|
|
Sets the size of points in pixel.
|
|
Sets the size of text drawn with DrawText().
|
|
Sets the texture for texture mapping, or disables texture mapping.
|
|
Sets the texture repetition factor.
|
|
Set the perspective angle which affects the modelview.
|
|
Set the size of the visualization window.
|
|
Starts an overlay block.
Note that the orthographic projection is along the z-axis. This means, that even though an element at different z-depths appears the same, the z-coordinate allows you to define a z-order in which elements are drawn. Here is an example.
StartOverlay(); :Red; DrawLine(0,0,0, 50,50,0); :Green; DrawLine(100,0,0, 50,50,0); :Blue; DrawLine(50,50,0, 50,100,0); EndOverlay(); This produces the following visualization.
![]() This shows that independent of how the standard visualization basis frame is rotated, the lines in the overlay block are drawn in the same way. |
|
Start a new view.
ExampleScripts/StartView1.clu .
// Start a view with its bottom-left corner // at the bottom-left corner of the visualization // window, and having half its width and height. StartView(0,0, 0.5, 0.5); // Start an overlay StartOverlay(); // Draw a rectangle along the // outer border of the view. SetLineWidth(4); :Red; DrawLine(VecE3(0,0), VecE3(100,0)); DrawLine(VecE3(100,0), VecE3(100,100)); DrawLine(VecE3(100,100), VecE3(0,100)); DrawLine(VecE3(0,100), VecE3(0,0)); SetLineWidth(2); // End the overlay EndOverlay(); // Now draw a sphere in the view :Blue; DrawSphere(VecE3(0,0,0), 1); // End the view EndView(); // Draw the same sphere in the main view :Green; DrawSphere(VecE3(0,0,0), 1); Output:
![]() |
|
Translates the drawing frame.
|
|
Translates the drawing frame.
|
|
Translate the projectview matrix of OpenGl.
|
|
Translate the projectview matrix of OpenGl.
|