[x3d-public] ECMAScript 6 SAI proposal (simple for now).
John Carlson
yottzumm at gmail.com
Thu Apr 30 07:06:12 PDT 2020
Here is another place to pick up the library:
http://coderextreme.net/es6.zip
I need some examples!
Suggest possibly modifying ECMAScript SAI examples.
John
On Thu, Apr 30, 2020 at 8:53 AM John Carlson <yottzumm at gmail.com> wrote:
> Mostly just construction right now. I'm not quite sure how to do protos.
> Below is the first example.
>
> Code is here:
> https://sourceforge.net/p/x3d/code/HEAD/tree/www.web3d.org/x3d/stylesheets/es6 (if
> you can access it. I can't right now).
>
> Comments?
>
> John
>
>
> $ cat app.mjs
> "use strict"
>
> import X3D from './x3d.mjs';
> import { head, meta, Scene, Transform, Group, Material, Shape, Box,
> Appearance } from './x3d.mjs';
> import { MFNode, SFColor, SFVec3f, SFRotation } from './x3d.mjs';
>
> var x3d = new X3D({
> head : new head({
> meta : [
> new meta({
> name : "John W",
> content : "Carlson, I"
> }),
> new meta({
> name : "John A",
> content : "Carlson, II"
> }),
> new meta({
> name : "John R",
> content : "Carlson, III"
> })
> ]
> }),
> Scene : new Scene({
> children : new MFNode([
> new Group({
> children : new MFNode([
> new Shape({
> appearance : new
> Appearance({
> material : new
> Material({
>
> diffuseColor : new SFColor([1, 0, 0])
> })
> }),
> geometry : new Box()
> })
> ])
> }),
> new Transform({
> translation : new SFVec3f([1, 2, 3]),
> scale: new SFVec3f([4, 5, 6]),
> rotation: new SFRotation([7, 8, 9, 3.14])
> })
> ])
> })
> })
>
> console.log(x3d.toXMLNode());
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20200430/5c95c532/attachment.html>
More information about the x3d-public
mailing list