Giter VIP home page Giter VIP logo

x_ite's Introduction

X_ITE โ€” X_ITE X3D Browser

npm Version Build Size jsDelivr Hits npm Downloads DeepScan grade

Introduction

X_ITE is a robust X3D JavaScript WebGL browser that is compatible with all major web browsers and can be used as a full standard X3D browser as well as a VRML viewer.

๐Ÿš€ For more information and a live preview, please visit our home page.

Quick Links

jsDelivr CDN

jsDelivr is an open-source content delivery network (CDN) renowned for its no-cost access, swift performance, and reliable service.

Latest Stable Version

If you are a developer or you always wanna be up to date:

<script src="https://cdn.jsdelivr.net/npm/x_ite@latest/dist/x_ite.min.js"></script>
<!-- or as ES module for use in scripts -->
<script type="module">
import X3D from "https://cdn.jsdelivr.net/npm/x_ite@latest/dist/x_ite.min.mjs";
</script>

Info: It is no longer necessary to include the CSS file.

But consider to use a fixed version if you use X_ITE for production.

Usage

This script initializes an X3D canvas within an HTML page, configuring it to contain a scene, a camera and a geometric cube with default material properties. It then animates the rotation of the cube within the scene, ensuring that the camera captures the dynamic action.

Declarative Syntax

<script src="https://cdn.jsdelivr.net/npm/x_ite@latest/dist/x_ite.min.js"></script>
<x3d-canvas>
  <X3D profile='Interchange' version='4.0'>
    <head>
      <unit category='angle' name='degree' conversionFactor='0.017453292519943295'></unit>
    </head>
    <Scene>
      <Viewpoint
          description='Initial View'
          position='2.869677 3.854335 8.769781'
          orientation='-0.7765887 0.6177187 0.1238285 28.9476440862198'></Viewpoint>
      <Transform DEF='Box'
          rotation='0 1 0 0'>
        <Shape>
          <Appearance>
            <Material></Material>
          </Appearance>
          <Box></Box>
        </Shape>
      </Transform>
      <TimeSensor DEF='Timer'
          cycleInterval='10'
          loop='true'></TimeSensor>
      <OrientationInterpolator DEF='Rotor'
          key='0, 0.25, 0.5, 0.75, 1'
          keyValue='0 1 0 0, 0 1 0 90, 0 1 0 180, 0 1 0 270, 0 1 0 0'></OrientationInterpolator>
      <ROUTE fromNode='Timer' fromField='fraction_changed' toNode='Rotor' toField='set_fraction'></ROUTE>
      <ROUTE fromNode='Rotor' fromField='value_changed' toNode='Box' toField='set_rotation'></ROUTE>
    </Scene>
  </X3D>
</x3d-canvas>

Pure JavaScript

The same scene can also be created using pure JavaScript:

<script type="module">
import X3D from "https://cdn.jsdelivr.net/npm/x_ite@latest/dist/x_ite.min.mjs";

const
   browser = X3D .getBrowser (),
   scene   = browser .currentScene;

// Viewpoint

const viewpointNode = scene .createNode ("Viewpoint");

viewpointNode .set_bind    = true;
viewpointNode .description = "Initial View";
viewpointNode .position    = new X3D .SFVec3f (2.869677, 3.854335, 8.769781);
viewpointNode .orientation = new X3D .SFRotation (-0.7765887, 0.6177187, 0.1238285, 0.5052317);

scene .rootNodes .push (viewpointNode);

// Box

const
   transformNode  = scene .createNode ("Transform"),
   shapeNode      = scene .createNode ("Shape"),
   appearanceNode = scene .createNode ("Appearance"),
   materialNode   = scene .createNode ("Material"),
   boxNode        = scene .createNode ("Box");

appearanceNode .material = materialNode;

shapeNode .appearance = appearanceNode;
shapeNode .geometry   = boxNode;

transformNode .children .push (shapeNode);

scene .rootNodes .push (transformNode);

// Give the node a name if you like.
scene .addNamedNode ("Box", transformNode);

// Animation

const
   timeSensorNode   = scene .createNode ("TimeSensor"),
   interpolatorNode = scene .createNode ("OrientationInterpolator");

timeSensorNode .cycleInterval = 10;
timeSensorNode .loop          = true;

for (let i = 0; i < 5; ++ i)
{
  interpolatorNode .key [i]      = i / 4;
  interpolatorNode .keyValue [i] = new X3D .SFRotation (0, 1, 0, Math .PI * i / 2);
}

scene .rootNodes .push (timeSensorNode, interpolatorNode);

// Routes

scene .addRoute (timeSensorNode,   "fraction_changed", interpolatorNode, "set_fraction");
scene .addRoute (interpolatorNode, "value_changed",    transformNode,    "set_rotation");
</script>
<!-- x3d-canvas element comes here: -->
<x3d-canvas></x3d-canvas>

NPM Usage

To install, use the following command:

$ npm install x_ite

Maybe you are curious now how to use X_ITE with Electron?

Funding

X_ITE needs your support. If you become a Patreon, we can improve X_ITE even better.

License

X_ITE is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License version 3 only, as published by the Free Software Foundation.

See Also

  • x3d-tidy โ€” X3D converter, beautifier and minimizer
  • x3d-image โ€” render image files from X3D
  • sunrize โ€” a multi-platform X3D editor

x_ite's People

Contributors

andreasplesch avatar coderextreme avatar create3000 avatar dependabot[bot] avatar gwhitney avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

x_ite's Issues

VRML Inline nodes

I have a VRML2 world that contains three Inline nodes. This still works as it was originally created locally in Cortona3D and IE11. However, when it is included in an X-ite wrapper and run locally or remotely, only the first Inline appears. the second and third do not.

To Reproduce
Steps to reproduce the behavior:

  1. Go to 'http://lhodges.users37.interdns.co.uk/me/xcard2/waddl_ard.htm'
  2. Click on 'the still picture'

Expected behavior
The still picture shows approximately what should be seen.

Desktop (please complete the following information):

  • OS: Windows 7
  • Browser: Chrome, Firefox, Cyberfox, Basilisc
    Also: there is no sound with Firefox or Cyberfox and Safari does not load at all.

Additional context
Here is the beginning of the VRML2 world:

#VRML V2.0 utf8 jigH.wrl V0.1
WorldInfo {
title "Jig for HP machines"
info ["Lawrence C.Hodges 10th December 2000
"]
}

NavigationInfo {
type [ "FLY", "WALK", "EXAMINE", "ANY"]
headlight FALSE
}

-------------------- model ---------------------

Inline {
url "dancer.wrl"
}

Inline {
url "musician.wrl"
}

Inline {
url "ground.wrl"
}

Chrome not running X-ITE

I've downloaded X-ITE 4.5.6. and attempted to run the example given in the section 'Embedding X-LITE within a Web Page'. This runs in Firefox, Cyberfox and Safari but NOT in Chrome (my default browser) or IE11. I have what I am told is the latest version Chrome: Version 75.0.3770.100 (Official Build) (64-bit)

Duplicate retrievals from dynamically created Inline node

Describe the bug
When I try to dynamically create an Inline node, I see two network requests for the same asset. I expect to see one.

(I'm uncertain if this is related to another issue I'm having where a quickly dynamically generated Import is sometimes usable and sometimes not.)

To Reproduce
The below is a part of the code I'm using. I can write a full test case later if needed

    function addSO(browser, obj) {
        let inline = browser.currentScene.createNode("Inline");
        inline.url = new X3D.MFString(obj.url);
        browser.currentScene.addRootNode(inline);
    }

Additional context
Add any other context about the problem here.

Can'd read .mid or .midi file in Audio Clip

In a .wrl world I have the following node:
Sound {
maxBack 300
maxFront 300
minBack 1
minFront 1
priority 0

spatialize    FALSE	 
source DEF  AC AudioClip { 
	description   "Morris Dance Tune: The Sussex Carol"
	loop          FALSE	
	url           "sussex.mid"
}

}

The animation associated with it runs but without music. The console output gives me:
x_ite.min.js:42 Error loading audio: http://lhodges.users37.interdns.co.uk/me/xcard/sussex.mid

replacing 'sussex.mid' with 'sussex.mp3' ( a file derived from 'sussex.mid') works OK. 'sussex.mid' works locally with a Cortona3D/EI11 combination.

Is this a bug or is there some deficiency in my .mid file?

**To Run the animation with the working .mp3 version, go to:
http://lhodges.users37.interdns.co.uk/me/xcard/waddl_ard.htm

and click on the picture as suggested.

Desktop (please complete the following information):

  • OS: W7
  • Browser: chrome
  • Version: 75.0.3770.100 (Official Build) (64-bit)

new PointProperties fields missing in HTML support

Describe the bug
The new PointProperties node has fields which are not supported as DOM attributes.

To Reproduce
https://raw.githack.com/jamesleesaunders/d3-x3d/ScatterPlot/examples/X_ITE/chart/ParticlePlot.html

Expected behavior
Points should be larger

fix by

define ('x_ite/Parser/HTMLSupport',[],function ()
{
"use strict";

	var HTMLSupport =
	{
		attributeLowerCaseToCamelCase:
		{
			"pointsizeminvalue" : "pointSizeMinValue",
			"pointsizemaxvalue" : "pointSizeMaxValue",
			"pointsizescalefactor" : "pointSizeScaleFactor",
			"pointsizeattenuation" : "pointSizeAttenuation",					
			"accesstype" : "accessType",
...

not playing mpeg 1 movie

i guess due to lack of browser movie support.

should Titania also not support in compatibility mode?

An appearance with a diffuseColor and an RGB texture should ignore the diffuseColor

Describe the bug
When an Appearance has both a Material with a diffuseColor and an ImageTexture with RGB(A) components, the diffuseColor should be ignored, as IDRGB is not referenced when an RGB texture is in use. It currently is not.

Screenshots
The below screenshots show a globe with an RGB texture and a diffuseColor of 1 0 0. As far as I can tell, InstantReality is correct and X_ITE is incorrect

InstantReality player

image

X_ITE

image

Additional context
#38 has some discussion about this issue, however, it looks like there is a misreading of the spec as in the "Lighting 'on'" table, IDRGB, the diffuseColor, is not used for that scenario. The English text above the table seems to incorrectly describe the effect of the table, unless I am misunderstanding the table.
The VRML spec's English description seems to agree with the table, and not with the English description in the X3D spec.

Attached are files I used for testing. The relevant files are HelloWorld and HelloWorldXITE (the other files are because I was testing a differing implementation).

DiffuseColor.zip

intel hd3000 on Chrome

On an older Windows7 laptop with Intel HD graphics, the shaders do not compile on latest Chrome. Firefox still works, loading very slowly.

x_ite.js:5423 Couldn't initialize ComposedShader 'GouraudShader': C:\fakepath(120,12): error X6077: texld/texldb/texldp/dsx/dsy instructions with r# as source cannot be used inside dynamic conditional 'if' blocks, dynamic conditional subroutine calls, or loop/rep with break*. 

Warning: D3D shader compilation failed with default flags. (ps_3_0)
 Retrying with avoid flow control
C:\fakepath(120,12): error X6077: texld/texldb/texldp/dsx/dsy instructions with r# as source cannot be used inside dynamic conditional 'if' blocks, dynamic conditional subroutine calls, or loop/rep with break*. 

Warning: D3D shader compilation failed with avoid flow control flags. (ps_3_0)
 Retrying with prefer flow control
C:\fakepath(120,12): error X6077: texld/texldb/texldp/dsx/dsy instructions with r# as source cannot be used inside dynamic conditional 'if' blocks, dynamic conditional subroutine calls, or loop/rep with break*. 

Warning: D3D shader compilation failed with prefer flow control flags. (ps_3_0)

Failed to create D3D Shaders

Problem with build:

$ make all
perl -pi -e 's/return (?:true|false);/return false;/sg' src/x_ite/DEBUG.js
node_modules/requirejs/bin/r.js -o x_ite.build.js
Error: Error: ENOENT: no such file or directory, lstat 'C:\Users\coderextreme\x_ite\x_ite.build.js'
at Object.realpathSync (fs.js:1657:15)

make: *** [Makefile:7: all] Error 1

Support for JPG image format?

X_CIT gives error that it doesn't recognize the Script node

Describe the bug
lamppost is a lamp that you turn on or off by clicking on it. But when I load it into an X_ITE window, it reports an error: "XML Parser Error: Unkown node type 'Script'."

To Reproduce
Steps to reproduce the behavior:
Look at attached file lamppostxi.txt, and convert it to lamppostxi.x3d and open it using an X_ITE in the regular way. Then look at the errors reported by the browser. (mine is a Safari browser and I looked at the error with "Develop -> Show Javascript Console".

Expected behavior
If it recognized the "Script" node, it would turn the lamp on or off if you click on it. The error message of course explains why this doesn't happen: it doesn't recognize a "Script" node.

I also attached lampposterror.png, showing what I see when I open the file. You can see the lamppost on the X3DCanvas. But look at the error log below.

This is Mac OS Mohave 10.14
Safari Version 12

I downloaded other examples from the create3000.de website which included Script nodes (such as the FlashingLights example), and they work fine. But I don't know if I needed an extra command in the file header to make it recognize the Script node itself, or if Script nodes can only be used inside certain grouping nodes such as or . I also tried temporarily deleting the "component" commands in the section to see if that made a difference in the FlashingLights. But it didn't. It still worked.

Maybe you can see in my lamppostxi file why the Script node isn't recognized where it is located. By the way, it works in Instant Player. Thanks.

lampposterror

lamppostxi.txt

CDATA section should not have leading whitespace

Apply this patch and test (untested, except in X3DJSONLD). I'll try to create a build, but no guarantees (see previous issue). Patch is to trim() leading and trailing whitespace from CDATA sections.

$ git diff -w .
diff --git a/src/x_ite/Parser/JSONParser.js b/src/x_ite/Parser/JSONParser.js
index 9abcce6..6a03ad5 100644
--- a/src/x_ite/Parser/JSONParser.js
+++ b/src/x_ite/Parser/JSONParser.js
@@ -157,7 +157,7 @@ function (
*/
JSONParser .prototype.
CDATACreateFunction = function(document, element, str) {

  •                   var y = str.replace(/\\"/g, "\\\"")
    
  •                   var y = str.trim().replace(/\\"/g, "\\\"")
                              .replace(/&lt;/g, "<")
                              .replace(/&gt;/g, ">")
                              .replace(/&amp;/g, "&");
    

unable to open local world

edited "x_ite-4.2.4/example.html" for all local use.

(BTW why does this example have remote resource files, when they are downloaded in the zip and are in the same folder?)

<!DOCTYPE html>
  <html>
   <head>
    <meta charset="utf-8"/>
    <link rel="stylesheet" type="text/css" href="x_ite.css"/>
    <script type="text/javascript" src="x_ite.js"></script>
    <style>
    X3DCanvas {
      width: 1000px;
      height: 563px;
    }
    </style>
  </head>
  <body>
    <X3DCanvas src="../test2.wrl">
      <p>Your browser may not support all features required by X_ITE!</p>
    </X3DCanvas>
  </body>
</html>

browsers firefox and chrome fail and produce error;

Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at file:///home/simon/Downloads/x_ite/test2.wrl. (Reason: CORS request not http).

broken (type violation) world causes crash.

test2

Note: you have to move in order to get the crash, presumably due to the first event being sent.

console output:

flatpak run de.create3000.titania

*** The browser is requested to replace the world with ''.

*** The browser is requested to replace the world with ''.

Done loading scene 'file:///app/share/titania/tools/library/RoundedRectangle2D.x3dv'.
Done loading image 'file:///app/share/titania/tools/library/gradient.png'.



Welcome to Titania X3D Browser 4.3.1:
Compiled at Aug 29 2018 16:06:39
Current Graphics Renderer
Name: X.Org AMD Radeon HD 8600 Series (AMD OLAND / DRM 3.25.0 / 4.17.17-87.current, LLVM 5.0.0)
OpenGL extension version: 3.0 Mesa 17.2.7
Shading language version: 1.30, 1.0 es X_ITE (default)
Rendering Properties
Texture units: 8 / 184
Max texture size: 16384 ร— 16384 pixel
Max lights: 8
Max clip planes: 6
Antialiased: false
Color depth: 32 bits
Texture memory: 1.0 kB
Max vertex uniform vectors: 4096
Max fragment uniform vectors: 4096
Max vertex attribs: 16
Current Javascript Engine
Name: Mozilla Foundation SpiderMonkey
Description: JavaScript-C 1.8.5 2011-03-31
Version: ECMAv5



Done loading scene 'file:///app/share/titania/tools/AxonometricGridTool.x3dv'.
Done loading scene 'file:///app/share/titania/tools/AngleGridTool.x3dv'.
Done loading scene 'file:///app/share/titania/tools/GridTool.x3dv'.
Done loading scene '/app/share/titania/ui/Logo.x3dv'.



Welcome to Titania X3D Browser 4.3.1:
Compiled at Aug 29 2018 16:06:39
Current Graphics Renderer
Name: X.Org AMD Radeon HD 8600 Series (AMD OLAND / DRM 3.25.0 / 4.17.17-87.current, LLVM 5.0.0)
OpenGL extension version: 3.0 Mesa 17.2.7
Shading language version: 1.30, 1.0 es X_ITE (default)
Rendering Properties
Texture units: 8 / 184
Max texture size: 16384 ร— 16384 pixel
Max lights: 8
Max clip planes: 6
Antialiased: false
Color depth: 32 bits
Texture memory: 1.0 kB
Max vertex uniform vectors: 4096
Max fragment uniform vectors: 4096
Max vertex attribs: 16
Current Javascript Engine
Name: Mozilla Foundation SpiderMonkey
Description: JavaScript-C 1.8.5 2011-03-31
Version: ECMAv5



Done loading scene 'file:///app/share/titania/pages/about/splash.x3dv'.
Done loading scene '/app/share/titania/pages/about/library/Colors.x3dv#Red'.
Done loading scene 'file:///app/share/titania/tools/library/ToolShader.x3dv'.
Done loading scene 'file:///app/share/titania/tools/library/ToolShader.x3dv'.
Done loading scene 'file:///app/share/titania/tools/library/ToolShader.x3dv'.
Done loading scene 'file:///app/share/titania/tools/library/Grid.x3dv#Grid'.
Done loading scene 'file:///app/share/titania/tools/library/AngleGrid.x3dv#AngleGrid'.
Done loading scene 'file:///app/share/titania/tools/library/AxonometricGrid.x3dv#AxonometricGrid'.

*** The browser is requested to replace the world with 'file:///app/share/titania/pages/about/splash.x3dv'.

*** The browser is requested to replace the world with '/app/share/titania/ui/Logo.x3dv'.

Done loading scene 'file:///app/share/titania/tools/library/RoundedRectangle2D.x3dv'.
Done loading image 'file:///app/share/titania/tools/library/gradient.png'.
Done loading scene 'file:///app/share/titania/pages/about/tab.x3dv'.
Done loading scene 'file:///app/share/titania/tools/library/RoundedRectangle2D.x3dv'.
Done loading image 'file:///app/share/titania/tools/library/gradient.png'.
Done loading scene 'file:///app/share/titania/pages/about/library/Rotor.x3dv'.

*** The browser is requested to replace the world with 'file:///app/share/titania/pages/about/tab.x3dv'.

Bad Image: Magick: zero-length blob not permitted ' @ error/blob.c/BlobToImage/341, in URL 'data:'. Bad Image: Magick: zero-length blob not permitted ' @ error/blob.c/BlobToImage/341, in URL 'data:'.
Done loading image 'file:///app/share/titania/pages/about/tab.x3dv'.
Done loading image 'file:///app/share/titania/pages/about/tab.x3dv'.
Done loading image 'file:///app/share/titania/pages/about/tab.x3dv'.
Done loading image 'file:///app/share/titania/pages/about/tab.x3dv'.
Done loading image 'file:///app/share/titania/pages/about/tab.x3dv'.
Done loading image 'file:///app/share/titania/pages/about/tab.x3dv'.
Done loading image 'file:///app/share/titania/pages/about/tab.x3dv'.
Done loading scene 'file:///home/simon/Desktop/test2.wrl'.

*** The browser is requested to replace the world with 'file:///home/simon/Desktop/test2.wrl'.

(titania:3): Gtk-CRITICAL **: _gtk_accel_group_attach: assertion 'g_slist_find (accel_group->priv->acceleratables, object) == NULL' failed

(titania:3): Gtk-CRITICAL **: _gtk_accel_group_attach: assertion 'g_slist_find (accel_group->priv->acceleratables, object) == NULL' failed
################################################################################

Backtrace

Error: signal 11 SIGSEGV

Invalid memory reference

################################################################################
/app/lib/libtitania-standard.so.0(_ZN7titania17backtrace_symbolsB5cxx11Em+0x2b) [0x7f6587d2470b]
/app/lib/libtitania-standard.so.0(+0x110d2f) [0x7f6587d24d2f]
/app/lib/libtitania-standard.so.0(+0x111406) [0x7f6587d25406]
/lib/libc.so.6() [0x3153a330b0]
/app/lib/libmozjs185.so.1.0(+0xdb6f9) [0x7f658d71a6f9]
/app/lib/libmozjs185.so.1.0(+0xdbebd) [0x7f658d71aebd]
/app/lib/libmozjs185.so.1.0(JS_CallFunctionValue+0x42) [0x7f658d6892e2]
/app/lib/libtitania-x3d.so.0(_ZN7titania3X3D12spidermonkey7Context9set_fieldEPNS0_18X3DFieldDefinitionERKm+0x29b) [0x7f658a33441b]
/app/lib/libtitania-x3d.so.0(_ZNK7titania3X3D9X3DOutput16processInterestsEv+0xbd) [0x7f6589b972fd]
/app/lib/libtitania-x3d.so.0(_ZN7titania3X3D18X3DFieldDefinition12processEventERKSt10shared_ptrINS0_5EventEE+0xbf) [0x7f6589bbde8f]
/app/lib/libtitania-x3d.so.0(_ZN7titania3X3D6Router13processEventsEv+0x39) [0x7f658a525339]
/app/lib/libtitania-x3d.so.0(_ZN7titania3X3D17X3DBrowserContext6updateEv+0x168) [0x7f6589d2fc38]
/app/lib/libtitania-x3d.so.0(_ZN7titania3X3D17X3DBrowserContext9on_renderEv+0x11) [0x7f6589d30701]
/app/lib/libtitania-x3d.so.0(_ZN7titania3X3D19X3DRenderingSurface10on_timeoutEv+0x1a5) [0x7f658a51e6b5]
/app/lib/libglibmm-2.4.so.1(+0x57b92) [0x7f658ce8ab92]
/lib/libglib-2.0.so.0(+0x4ad53) [0x7f658b670d53]
/lib/libglib-2.0.so.0(g_main_context_dispatch+0x15a) [0x7f658b6702ca]
/lib/libglib-2.0.so.0(+0x4a688) [0x7f658b670688]
/lib/libglib-2.0.so.0(g_main_context_iteration+0x2c) [0x7f658b67073c]
/lib/libgio-2.0.so.0(g_application_run+0x20d) [0x7f658f5639ad]
titania(_ZN7titania4puck18BrowserApplication4mainEiPPc+0x2f) [0x78ceaf]
titania(main+0x19d) [0x78d6dd]
/lib/libc.so.6(__libc_start_main+0xf1) [0x3153a20291]
titania(_start+0x2a) [0x7bc89a]

dataURL regex

FileLoader uses this regex

		dataURL       = /^data\:([^]*?)(?:;([^]*?))?(;base64)?,([^]*)$/

It then uses .exec to apply to a URL. Here is an example:

r=dataURL.exec('data:application/xml;base64,wrwljrkew')
(5) ["data:application/xml;base64,wrwljrkew", "application/xml", "base64", undefined, "wrwljrkew", index: 0, input: "data:application/xml;base64,wrwljrkew", groups: undefined]
0: "data:application/xml;base64,wrwljrkew"
1: "application/xml"
2: "base64"
3: undefined
4: "wrwljrkew"
groups: undefined
index: 0
input: "data:application/xml;base64,wrwljrkew"
length: 5
__proto__: Array(0)

But then it looks for base64 in the result to convert back here:

if (result [3] === ";base64")

This seems off.

It should use result[2].

And it should compare to base64, not ;base64

Audio Nodes are silent in X_ITE

Describe the bug
I created a simple x3d file of a red ball. When you click on it you hear a pop. I tested it on two other browsers and they work. But in the X_ITE screen, the red ball appears but I don't hear anything when I click.

I also notice that no other x3d files with audio play anything here either. And there are no error or warning messages from the browser.

Evidently audio enabled and at regular listening volume is not the default setting. There must be something that needs to be turned on inside the X_ITE javascript code to turn the sound on. But I haven't learned to configure those things.

To Reproduce
Load the file code (shown below) into an X_CITE window. You need to provide your own file called pop.wav because I can't attach a sound file.

Expected behavior
Click on the red ball in the scene to hear a pop.

Screenshots
N/A. No errors or warnings occur.

Desktop (please complete the following information):
Mac OS Mojave 10.14
Safari 12.0

Additional context
Other html files on my localhost play sound because I enabled it on this url.

CODE:
trysound.txt

focusing X3DCanvas element doesn't allow viewpoint navigation

seem to always need to click on scene for it to get focus and have pgup/dn navigation.

ex. this isn't working as expected.

  <X3DCanvas src="scene.wrl" onLoad="this.focus()">
      <p>Your browser may not support all features required by X_ITE!</p>
    </X3DCanvas>

new components with importDocument

Now that many components are loaded on demand, is there a way to trigger loading of new components with importDocument followed by replaceWorkd ?
For example, going from a Scene with Immersive profile to a Scene with Full profile.

getting X3D is not defined

This code doesn't work:

function load_X_ITE_XML(content, selector) {
	X3D(function() {
		var browser = X3D.getBrowser(selector);
		browser.replaceWorld(browser.createX3DFromString(content));
	}, function() {
		alert("Failed to render XML to X_ITE");
	});
}

triangulation of concave face fails when face has coincident point(s).

this shape shows a missing triangle. (works in Titania.)
guess would be 'convex' issue

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE X3D PUBLIC "ISO//Web3D//DTD X3D 3.0//EN" "http://www.web3d.org/specifications/x3d-3.0.dtd">
<X3D profile='Interchange' version='3.0' xmlns:xsd='http://www.w3.org/2001/XMLSchema-instance' xsd:noNamespaceSchemaLocation='http://www.web3d.org/specifications/x3d-3.0.xsd'>
  <Scene>
    <Shape DEF='body'>
      <Appearance>
        <Material/>
      </Appearance>
      <Extrusion
          convex='false'
          crossSection='0 -0.5, -0.1 -0.5, -0.184776 -0.18696, -0.184776 0.18696, -0.1 0.5, -0.1 0.5, 0 0.5, 0.15 0.3, 0 0.25, 0 -0.25, 0.15 -0.3, 0.136798 -0.336543, 0 -0.5'
          />
    </Shape>
  </Scene>
</X3D>

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.