Comments (3)
Here is a minimal example: https://raw.githack.com/andreasplesch/Library/gh-pages/Examples/Dolphin/sai_test.html
This scene construction does not seem to work:
var browser = X3D.getBrowser(document.querySelector('X3DCanvas'));
var scene = browser.createScene();
var bg = new X3D.SFNode(scene.createNode('Background', false));
bg.skyColor = X3D.MFColor(X3D.SFColor(0, 0, 1));
scene.rootNodes.push(bg);
browser.replaceWorld(scene);//does not work
//browser.replaceWorld(browser.createX3DFromString(scene.toXMLString()));//works
from x_ite.
It turns out I was overthinking it. .createNode(nodename) without the ,false already creates the SFNode wrapper and also sets the node fields up properly. So this works:
var browser = X3D.getBrowser(document.querySelector('X3DCanvas'));
var scene = browser.createScene();
var bg = scene.createNode('Background');
bg.skyColor = X3D.MFColor(X3D.SFColor(0, 0, 1));
scene.rootNodes.push(bg);
browser.replaceWorld(scene);//works now
//browser.replaceWorld(browser.createX3DFromString(scene.toXMLString()));//also works
from x_ite.
I am happy to hear that the SAI interface works properly. It is important that the same browser (canvas) is used for displaying and creation of nodes. The extra boolean argument of X3DScene.createNode is only for internal use, just use createNode as in the spec.
Best regards, Holger.
from x_ite.
Related Issues (20)
- Issue with model in X3D archives HOT 2
- Can't use x_ite from inside a Firefox extension; can ResizeSensor.js be pruned? HOT 9
- Scientific data visualization HOT 6
- Weird shader effects, missing images, possibly due to reconfiguring Firewall, hostname, DNS servers HOT 1
- Custom elements issue with x_ite.mjs in Microsoft Edge? HOT 3
- npx sunrize [files] HOT 5
- X_ITE React implementation questions HOT 5
- "aspectRatio" not supported? HOT 4
- Despite no errors on the console, X_ITE shows no graphics HOT 10
- Use RENDERER on Firefox HOT 1
- ExternProtoDeclare not downloading? X3D checks in X3D-Edit. HOT 3
- Mono Sound plays only over left speaker HOT 3
- How to start X_ITE in a browser window in fullscreen mode HOT 3
- "Better" webpack.config.js, for Git Bash under Windows 10 HOT 5
- Replace webpack "string-replace-webpack-plugin" or provide dependency overrides in package.json HOT 2
- Adding a new node HOT 13
- Filling up an empty scene with Javascript HOT 8
- IndexedFaceSet solid false and alpha HOT 1
- EnvironmentLight has no effect (noob question number 3) HOT 3
- Unknown node type 'ProtoDeclare' 'ProtoBody' 'InstancedShape' HOT 10
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from x_ite.