Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

I also tried:

var('x,y,z')
lim = 2
gl = implicit_plot3d(x^2+y^2+z^2 == 1
                     , (x, -lim, lim), (y, -lim, lim), (z, -lim, lim)
                     , color='purple', mesh=True)
gl += text3d('test start\nHUGO\\n\ntest add', [1, 1, 1] )
gl

And the graphic object was opened with the web browser, in my case vivaldi. With Control+U i switched to the source. Searching for the HUGO inside the source, i found the lines...

var texts = [{"color": "#000000", "fontSize": 14.0, "fontFamily": ["monospace"], "fontStyle": "normal", "fontWeight": "normal", "opacity": 1.0, "text": "test start\nHUGO\\n\ntest add", "x": 1.0, "y": 1.0, "z": 1.0}];
for ( var i=0 ; i < texts.length ; i++ ) addText( texts[i] );

function addText( json ) {
    var sprite = addLabel( json.text, a[0]*json.x, a[1]*json.y, a[2]*json.z, json );
    sprite.userData = json;
}

And the js function addLabel works on the text as it randomly likes to do it.