Magic Leap MagicScript Landscape Application. LineNode

Prepare

Magic Leap One

https://www.magicleap.com/magic-leap-one

mlsdk v.0.20.0

https://creator.magicleap.com/downloads/lumin-sdk/overview

magic-script-cli v2.0.1

https://www.npmjs.com/package/magic-script-cli

magic-script-polyfills v2.2.0

https://www.npmjs.com/package/magic-script-polyfills

Create Project

magic-script init my-line org.magicscript.line "Line"

cd my-line

Code

Change app.js

import { LandscapeApp } from 'lumin';

export class App extends LandscapeApp {
onAppStart () {
let prism = this.requestNewPrism([1.0, 1.0, 1.0]);

const line = prism.createLineNode();

line.setColor([1.0, 1.0, 0.0, 1.0]);
line.addPoints([0.0, 0.0, 0.0]);
line.addPoints([-1.0, 0.5, 0.2]);

line.addLineBreak();
line.addPoints([1.0, 1.0, 0.0]);
line.addPoints([0.0, -1.0, -0.3]);

prism.getRootNode().addChild(line);
}
}

Build

magic-script build -i

Run

magic-script run --port=10000

Reference

LineNode(Magic Script API Doc)

https://docs.magicscript.org/lumin.LineNode.html

Line Nodes (LineNode)(Guide C++)

https://creator.magicleap.com/learn/guides/lrt-linenode

magicscript

https://www.magicscript.org/

Thanks!