Add this param to the end of the URL, in order to not redirect to the error page and be able to open the JS console:
https://human.biodigital.com/index.html#noErrorRedirect=true
myNode.addNode({ | |
type: "material", | |
color: [1,0,0] // Red | |
}); | |
myNode.addNode({ | |
type: "scale", | |
scale: [.1,.2,.3] | |
}); |
// Create an engine | |
var engine = Njn.createEngine({}); | |
//----------------------------------------------------------------------- | |
// Logging | |
//----------------------------------------------------------------------- | |
engine.log.info("All is well"); | |
engine.log.warn("Something looks dodgy"); |
The "hacks" section may be included on a module JSONs to specify engine | |
hacks that are to be applied to work around content errors. | |
Two flags are provided for working around the "vertex winding" bug in meshes exported by the bridge, where the triangles have inconsistent vertex ordering, which is what WebGL depends on to identify backfaces, which should culled on transparent objects. | |
Ordinarily, the engine would show backfaces on opaque objects, in order for inner surfaces to be visible when using the cross-section tool, and hide them on transparent objects, in order that they don't blend erroneously with front-faces and create the blotchy white artifacting. | |
1. To force backfaces to ALWAYS be shown on condition meshes, regardless of whether objects are opaque or transparent: | |
"hacks" : { |
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<title>SceneJS Example</title> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0"> | |
<style> | |
body { | |
margin: 0; |
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<title>SceneJS V3 Texture Layers</title> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0"> | |
<style> | |
body { | |
margin: 0; |
Add this param to the end of the URL, in order to not redirect to the error page and be able to open the JS console:
https://human.biodigital.com/index.html#noErrorRedirect=true
// Demonstrates multi-pass rendering in SceneJS. | |
// The scene graph below performs two passes to render its 3D view - one to render the scene objects | |
// to a color target (ie. a render buffer), and a second to apply that color target as a texture to | |
// a quad, while using a custom shader that applies a post-effect. | |
// Point SceneJS to the bundled plugins | |
SceneJS.setConfigs({ | |
pluginPath: "../api/latest/plugins" | |
}); | |
// Create a scene graph |
// To add depth-of-field blur to your scene, just wrap | |
// your nodes in a "effects/dof" node, like this: | |
var scene = SceneJS.createScene({ | |
nodes: [ | |
{ | |
type: "lookAt", | |
id: "myLookat", | |
eye: { x: 0, y: 200, z: 10 }, | |
look: { x: 0, y: 200,z: 0 } |
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<title>SceneJS Example</title> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0"> | |
<style> | |
body { | |
margin: 0; | |
-moz-user-select: -moz-none; |
var engine = new XEO.Engine(); | |
var scene = new XEO.Scene(engine); | |
var lookat = new XEO.Lookat(scene, { | |
eye: [0, 0, -100], | |
look: [0, 0, 0], | |
up: [0, 1, 0] | |
}); |