JavaScript must be enabled in order for you to use JSXGraph and JSXGraph reference. However, it seems JavaScript is either disabled or not supported by your browser.

Class Index | File Index

Elements
Classes

Class JXG.View3D

JXG.GeometryElement
      ↳ JXG.View3D

Creates a new 3D view. Do not use this constructor to create a 3D view. Use JXG.Board#create with type View3D instead.

Defined in: view3d.js.
Extends JXG.GeometryElement.

Class Summary
Constructor Attributes Constructor Name and Description
 
JXG.View3D(parents, parents, attributes)
3D view inside a JXGraph board.
Fields borrowed from class JXG.GeometryElement:
_org_type, _pos, ancestors, baseElement, board, childElements, dash, dashScale, descendants, draft, dragToTopOfLayer, dump, elementClass, elType, fillColor, fillOpacity, fixed, frozen, gradient, gradientAngle, gradientCX, gradientCY, gradientEndOffset, gradientFR, gradientFX, gradientFY, gradientR, gradientSecondColor, gradientSecondOpacity, gradientStartOffset, hasLabel, highlight, highlighted, highlightFillColor, highlightFillOpacity, highlightStrokeColor, highlightStrokeOpacity, highlightStrokeWidth, id, inherits, isDraggable, isLabel, isReal, lastDragTime, layer, lineCap, methodMap, mouseover, name, needsRegularUpdate, needsUpdate, notExistingParents, numTraces, parents, precision, priv, quadraticform, rendNode, rotatable, scalable, shadow, snapToGrid, stdform, strokeColor, strokeOpacity, strokeWidth, subs, symbolic, tabindex, trace, traceAttributes, traces, transformations, transitionDuration, transitionProperties, type, viewport, visible, visProp, visPropCalc, withLabel
Field Summary
Field Attributes Field Name and Description
 
Slider to adapt azimuth angle
 
Bounding box (cube) [[x1, x2], [y1,y2], [z1,z2]] of the 3D view
 
Default axes of the 3D view, contains the axes of the view or null.
 
Slider to adapt elevation angle
<private>  
An associative array / dictionary to store the objects of the board by name.
<private>  
<private>  
<private>  
An associative array containing all geometric objects belonging to the view.
 
Type of projection.
 
r
Distance of the view to the origin.
<private>  
Width and height [w, h] of the 3D view if elevation and azimuth are set to 0.
Fields borrowed from class JXG.GeometryElement:
_org_type, _pos, ancestors, baseElement, board, childElements, dash, dashScale, descendants, draft, dragToTopOfLayer, dump, elementClass, elType, fillColor, fillOpacity, fixed, frozen, gradient, gradientAngle, gradientCX, gradientCY, gradientEndOffset, gradientFR, gradientFX, gradientFY, gradientR, gradientSecondColor, gradientSecondOpacity, gradientStartOffset, hasLabel, highlight, highlighted, highlightFillColor, highlightFillOpacity, highlightStrokeColor, highlightStrokeOpacity, highlightStrokeWidth, id, inherits, isDraggable, isLabel, isReal, lastDragTime, layer, lineCap, methodMap, mouseover, name, needsRegularUpdate, needsUpdate, notExistingParents, numTraces, parents, precision, priv, quadraticform, rendNode, rotatable, scalable, shadow, snapToGrid, stdform, strokeColor, strokeOpacity, strokeWidth, subs, symbolic, tabindex, trace, traceAttributes, traces, transformations, transitionDuration, transitionProperties, type, viewport, visible, visProp, visPropCalc, withLabel
Method Summary
Method Attributes Method Name and Description
<private>  
Controls the navigation in az direction using either the keyboard or a pointer.
<private>  
Controls the navigation in el direction using either the keyboard or a pointer.
<private>  
 
 
create(elementType, parents, attributes)
Creates a new 3D element of type elementType.
<private>  
getMesh(func, interval_u, interval_v)
Generate mesh for a surface / plane.
 
Intersect a ray with the bounding cube of the 3D view.
 
intersectionPlanePlane(plane1, plane2, d)
 
Test if coordinates are inside of the bounding cube.
<private>  
Check if vertical dragging is enabled and which action is needed.
 
Changes view to the next view stored in the attribute `values`.
 
Changes view to the previous view stored in the attribute `values`.
 
project2DTo3DPlane(point2d, normal, foot)
Project a 2D coordinate to the plane defined by point "foot" and the normal vector `normal`.
 
project2DTo3DVertical(point2d, coords3D)
Project a 2D coordinate to a new 3D position by keeping the 3D x, y coordinates and changing only the z coordinate.
 
project3DTo2D(x, y, z)
Project 3D coordinates to 2D board coordinates The 3D coordinates are provides as three numbers x, y, z or one array of length 3.
 
Limit 3D coordinates to the bounding cube.
 
select(str, onlyByIdOrName)
Select a single or multiple elements at once.
 
Changes view to the determined view stored in the attribute `values`.
 
setView(az, el, r)
Sets camera view to the given values.
 
Methods borrowed from class JXG.GeometryElement:
_set, addChild, addDescendants, addParents, addParentsFromJCFunctions, addRotation, addTicks, addTransform, animate, bounds, clearTrace, cloneToBackground, countChildren, createGradient, createLabel, draggable, formatNumberLocale, fullUpdate, generatePolynomial, getAttribute, getAttributes, getLabelAnchor, getName, getParents, getProperty, getSnapSizes, getTextAnchor, getType, handleSnapToGrid, hasPoint, hide, hideElement, noHighlight, normalize, prepareUpdate, remove, removeAllTicks, removeChild, removeDescendants, removeTicks, resolveShortcuts, setArrow, setAttribute, setDash, setDisplayRendNode, setLabel, setLabelText, setName, setParents, setPosition, setPositionDirectly, setProperty, show, showElement, snapToPoints, update, updateRenderer, updateVisibility, useLocale
Events borrowed from class JXG.GeometryElement:
attribute, attribute:key, down, drag, keydrag, mousedown, mousedrag, mousemove, mouseout, mouseover, mouseup, move, out, over, pendown, pendrag, penup, touchdown, touchdrag, touchup, up
Class Detail
JXG.View3D(parents, parents, attributes)
3D view inside a JXGraph board.
Parameters:
{Array} parents
Array consisting of lower left corner [x, y] of the view inside the board, [width, height] of the view and box size [[x1, x2], [y1,y2], [z1,z2]]. If the view's azimuth=0 and elevation=0, the 3D view will cover a rectangle with lower left corner [x,y] and side lengths [w, h] of the board.


parents


attributes


Field Detail
az_slide
Slider to adapt azimuth angle

{array} bbox3D
Bounding box (cube) [[x1, x2], [y1,y2], [z1,z2]] of the 3D view

defaultAxes
Default axes of the 3D view, contains the axes of the view or null.
Default Value:
null

el_slide
Slider to adapt elevation angle

<private> {Object} elementsByName
An associative array / dictionary to store the objects of the board by name. The name of the object is the key and value is a reference to the object.

<private> {array} llftCorner

<private> matrix3D

<private> {Object} objects
An associative array containing all geometric objects belonging to the view. Key is the id of the object and value is a reference to the object.

{String} projectionType
Type of projection.

{Number} r
Distance of the view to the origin. In other words, its the radius of the sphere where the camera sits.view.board.update

<private> {array} size
Width and height [w, h] of the 3D view if elevation and azimuth are set to 0.
Method Detail
<private> _azEventHandler(event)
Controls the navigation in az direction using either the keyboard or a pointer.
Parameters:
{event} event
either the keydown or the pointer event
Returns:
view

<private> _elEventHandler(event)
Controls the navigation in el direction using either the keyboard or a pointer.
Parameters:
{event} event
either the keydown or the pointer event
Returns:
view

<private> {Array} _updateCentralProjection()
Returns:
{Array}

animateAzimuth()

{Object} create(elementType, parents, attributes)
Creates a new 3D element of type elementType.
Parameters:
{String} elementType
Type of the element to be constructed given as a string e.g. 'point3d' or 'surface3d'.
{Array} parents
Array of parent elements needed to construct the element e.g. coordinates for a 3D point or two 3D points to construct a line. This highly depends on the elementType that is constructed. See the corresponding JXG.create* methods for a list of possible parameters.
{Object} attributes Optional
An object containing the attributes to be set. This also depends on the elementType. Common attributes are name, visible, strokeColor.
Returns:
{Object} Reference to the created element. This is usually a GeometryElement3D, but can be an array containing two or more elements.

<private> getMesh(func, interval_u, interval_v)
Generate mesh for a surface / plane. Returns array [dataX, dataY] for a JSXGraph curve's updateDataArray function.
Parameters:
{Array|Function} func
{Array} interval_u
{Array} interval_v
Returns:
Array
Examples:
 var el = view.create('curve', [[], []]);
 el.updateDataArray = function () {
     var steps_u = Type.evaluate(this.visProp.stepsu),
          steps_v = Type.evaluate(this.visProp.stepsv),
          r_u = Type.evaluate(this.range_u),
          r_v = Type.evaluate(this.range_v),
          func, ret;

     if (this.F !== null) {
         func = this.F;
     } else {
         func = [this.X, this.Y, this.Z];
     }
     ret = this.view.getMesh(func,
         r_u.concat([steps_u]),
         r_v.concat([steps_v]));

     this.dataX = ret[0];
     this.dataY = ret[1];
 };

intersectionLineCube(p, d, r)
Intersect a ray with the bounding cube of the 3D view.
Parameters:
{Array} p
3D coordinates [x,y,z]
{Array} d
3D direction vector of the line (array of length 3)
{Number} r
direction of the ray (positive if r > 0, negative if r < 0).
Returns:
Affine ratio of the intersection of the line with the cube.

{Array} intersectionPlanePlane(plane1, plane2, d)
Parameters:
{JXG.Plane3D} plane1
{JXG.Plane3D} plane2
{JXG.Plane3D} d
Returns:
{Array} of length 2 containing the coordinates of the defining points of of the intersection segment.

isInCube(q)
Test if coordinates are inside of the bounding cube.
Parameters:
{array} q
3D coordinates [x,y,z] of a point.
Returns:
Boolean

<private> isVerticalDrag()
Check if vertical dragging is enabled and which action is needed. Default is shiftKey.
Returns:
Boolean

{Object} nextView()
Changes view to the next view stored in the attribute `values`.
Returns:
{Object} Reference to the view.
See:
View3D#values

{Object} previousView()
Changes view to the previous view stored in the attribute `values`.
Returns:
{Object} Reference to the view.
See:
View3D#values

{Array} project2DTo3DPlane(point2d, normal, foot)
Project a 2D coordinate to the plane defined by point "foot" and the normal vector `normal`.
Parameters:
{JXG.Point} point2d
{Array} normal
{Array} foot
Returns:
{Array} of length 4 containing the projected point in homogeneous coordinates.

{Array} project2DTo3DVertical(point2d, coords3D)
Project a 2D coordinate to a new 3D position by keeping the 3D x, y coordinates and changing only the z coordinate. All horizontal moves of the 2D point are ignored.
Parameters:
{JXG.Point} point2d
{Array} coords3D
Returns:
{Array} of length 4 containing the projected point in homogeneous coordinates.

{Array} project3DTo2D(x, y, z)
Project 3D coordinates to 2D board coordinates The 3D coordinates are provides as three numbers x, y, z or one array of length 3.
Parameters:
{Number|Array} x
{Number[]} y
{Number[]} z
Returns:
{Array} Array of length 3 containing the projection on to the board in homogeneous user coordinates.

project3DToCube(c3d)
Limit 3D coordinates to the bounding cube.
Parameters:
{Array} c3d
3D coordinates [x,y,z]
Returns:
Array with updated 3D coordinates.

{JXG.GeometryElement3D|JXG.Composition} select(str, onlyByIdOrName)
Select a single or multiple elements at once.
Parameters:
{String|Object|function} str
The name, id or a reference to a JSXGraph 3D element in the 3D view. An object will be used as a filter to return multiple elements at once filtered by the properties of the object.
{Boolean} onlyByIdOrName
If true (default:false) elements are only filtered by their id, name or groupId. The advanced filters consisting of objects or functions are ignored.
Returns:
{JXG.GeometryElement3D|JXG.Composition}
Examples:
// select the element with name A
view.select('A');

// select all elements with strokecolor set to 'red' (but not '#ff0000')
view.select({
  strokeColor: 'red'
});

// select all points on or below the x/y plane and make them black.
view.select({
  elType: 'point3d',
  Z: function (v) {
    return v <= 0;
  }
}).setAttribute({color: 'black'});

// select all elements
view.select(function (el) {
  return true;
});

{Object} setCurrentView(n)
Changes view to the determined view stored in the attribute `values`.
Parameters:
{Number} n
Index of view in attribute `values`.
Returns:
{Object} Reference to the view.
See:
View3D#values

{Object} setView(az, el, r)
Sets camera view to the given values.
Parameters:
{Number} az
Value of azimuth.
{Number} el
Value of elevation.
{Number} r Optional
Value of radius.
Returns:
{Object} Reference to the view.

stopAzimuth()

Documentation generated by JsDoc Toolkit 2.4.0 on Fri Mar 08 2024 12:21:02 GMT+0100 (Mitteleuropäische Normalzeit)