Text3D

Element

Construct a text element in a 3D view. A Text3D object is defined by 3 coordinates [x, y, z, text] or an array / function for the position of the text and a string or function defining the text.

That is, all numbers can also be provided as functions returning a number.

At the time being, text display is independent from the camera view.

Usage (signatures)
board.create('text3d', [x, y, z, txt, slideopt]);

The coordinates are given as x, y, z consisting of numbers of functions and the text. If an optional 3D element slide is supplied, the text acts like a glider on that element.

Parameters
Name Type Attributes Description
x NumberLike
y NumberLike
z NumberLike
txt String | function
slide JXG.GeometryElement3D <optional>
board.create('text3d', [F, txt, slideopt]);

Alternatively, the coordinates can be supplied as array or function returning an array. If an optional 3D element slide is supplied, the text acts like a glider on that element.

Parameters
Name Type Attributes Description
F Array | function
txt String | function
slide JXG.GeometryElement3D <optional>
Example
var bound = [-4, 6];
    var view = board.create('view3d',
        [[-4, -3], [8, 8],
        [bound, bound, bound]],
        {
            projection: 'central'
        });

    var txt1 = view.create('text3d', [[1, 2, 1], 'hello'], {
        fontSize: 20
    });

Attributes

Own

none

Inherited

Members

Own

(private, static) coords : Array

Description

Homogeneous coordinates of a Point3D, i.e. array of length 4: [w, x, y, z]. Usually, w=1 for finite points and w=0 for points which are infinitely far.

Type
Array
Example
p.coords;
Source
3d/text3d.js, line 57

(private, static) slide : JXG.GeometryElement3D

Description

Optional slide element, i.e. element the Point3D lives on.

Type
JXG.GeometryElement3D
Default Value
null
Example
p.slide;
Source
3d/text3d.js, line 83

Inherited

Methods

Own

(private, static) F()

Function or array of functions or array of numbers defining the coordinates of the point, used in updateCoords.

Details

See
  • updateCoords
Source
3d/text3d.js, line 71

(static) X() → {Number}

Get x-coordinate of a 3D point.

Example

p.X();

Returns

Type
Number

Details

Source
3d/text3d.js, line 98

(static) Y()

Get y-coordinate of a 3D point.

Example

p.Y();

Returns

Number

Details

Source
3d/text3d.js, line 113

(static) Z()

Get z-coordinate of a 3D point.

Example

p.Z();

Returns

Number

Details

Source
3d/text3d.js, line 128

(private, static) normalizeCoords() → {Object}

Normalize homogeneous coordinates such the the first coordinate (the w-coordinate is equal to 1 or 0)-

Example

p.normalizeCoords();

Returns

Reference to the Text3D object

Type
Object

Details

Source
3d/text3d.js, line 217

(static) setPosition(coords, noeventopt) → {Object}

Set the position of a 3D point.

Example

p.setPosition([1, 3, 4]);

Parameters

Name Type Attributes Description
coords Array

3D coordinates. Either of the form [x,y,z] (Euclidean) or [w,x,y,z] (homogeneous).

noevent Boolean <optional>

If true, no events are triggered.

Returns

Reference to the Text3D object

Type
Object

Details

Source
3d/text3d.js, line 238

(private, static) updateCoords() → {Object}

Update the homogeneous coords array.

Example

p.updateCoords();

Returns

Reference to the Text3D object

Type
Object

Details

Source
3d/text3d.js, line 164

Inherited

Events

Own

none

Inherited

Throws

If the element cannot be constructed with the given parent objects an exception is thrown.

Type
Exception

Details

Source
3d/text3d.js, line 361

Extends