LoginSignup
0
0

More than 3 years have passed since last update.

Magic Leap MagicScript Landscape Application. LineNode

Last updated at Posted at 2019-05-22

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!

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0