x_ite 5.0.3 → 6.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.vscode/settings.json +12 -5
- package/.vscode/tasks.json +25 -1
- package/Makefile +36 -28
- package/README.md +6 -11
- package/build/bin/dist.pl +0 -6
- package/build/bin/examples-and-tests.pl +75 -0
- package/build/bin/tests-menu.pl +57 -0
- package/build/bin/version.pl +7 -4
- package/build/parts/default.start.frag.js +3 -2
- package/dist/assets/components/annotation.js +3 -2
- package/dist/assets/components/annotation.min.js +1 -1
- package/dist/assets/components/cad-geometry.js +3 -2
- package/dist/assets/components/cad-geometry.min.js +1 -1
- package/dist/assets/components/cube-map-texturing.js +8 -20
- package/dist/assets/components/cube-map-texturing.min.js +1 -1
- package/dist/assets/components/dis.js +3 -2
- package/dist/assets/components/dis.min.js +1 -1
- package/dist/assets/components/event-utilities.js +4 -3
- package/dist/assets/components/event-utilities.min.js +1 -1
- package/dist/assets/components/geometry2d.js +38 -52
- package/dist/assets/components/geometry2d.min.js +1 -1
- package/dist/assets/components/geospatial.js +34 -1686
- package/dist/assets/components/geospatial.min.js +1 -1
- package/dist/assets/components/h-anim.js +71 -77
- package/dist/assets/components/h-anim.min.js +1 -1
- package/dist/assets/components/key-device-sensor.js +4 -3
- package/dist/assets/components/key-device-sensor.min.js +1 -1
- package/dist/assets/components/layout.js +101 -173
- package/dist/assets/components/layout.min.js +1 -1
- package/dist/assets/components/nurbs.js +3 -2
- package/dist/assets/components/nurbs.min.js +1 -1
- package/dist/assets/components/particle-systems.js +1926 -1669
- package/dist/assets/components/particle-systems.min.js +1 -1
- package/dist/assets/components/picking.js +34 -41
- package/dist/assets/components/picking.min.js +1 -1
- package/dist/assets/components/projective-texture-mapping.js +73 -86
- package/dist/assets/components/projective-texture-mapping.min.js +1 -1
- package/dist/assets/components/rigid-body-physics.js +37 -57
- package/dist/assets/components/rigid-body-physics.min.js +1 -1
- package/dist/assets/components/scripting.js +3 -2
- package/dist/assets/components/scripting.min.js +1 -1
- package/dist/assets/components/texturing-3d.js +27 -33
- package/dist/assets/components/texturing-3d.min.js +3 -3
- package/dist/assets/components/volume-rendering.js +12 -11
- package/dist/assets/components/volume-rendering.min.js +1 -1
- package/dist/assets/components/x_ite.js +3 -2
- package/dist/assets/components/x_ite.min.js +1 -1
- package/dist/assets/images/Shading.png +0 -0
- package/dist/assets/linetype/1.png +0 -0
- package/dist/assets/linetype/10.png +0 -0
- package/dist/assets/linetype/11.png +0 -0
- package/dist/assets/linetype/12.png +0 -0
- package/dist/assets/linetype/13.png +0 -0
- package/dist/assets/linetype/14.png +0 -0
- package/dist/assets/linetype/15.png +0 -0
- package/dist/assets/linetype/16.png +0 -0
- package/dist/assets/linetype/2.png +0 -0
- package/dist/assets/linetype/3.png +0 -0
- package/dist/assets/linetype/4.png +0 -0
- package/dist/assets/linetype/5.png +0 -0
- package/dist/assets/linetype/6.png +0 -0
- package/dist/assets/linetype/7.png +0 -0
- package/dist/assets/linetype/8.png +0 -0
- package/dist/assets/linetype/9.png +0 -0
- package/dist/assets/shaders/webgl1/Gouraud.vs +1 -1
- package/dist/assets/shaders/webgl1/Line.fs +0 -21
- package/dist/assets/shaders/webgl1/Line.vs +0 -10
- package/dist/assets/shaders/webgl1/PBR.fs +1 -1
- package/dist/assets/shaders/webgl1/PBR.vs +1 -1
- package/dist/assets/shaders/webgl1/Phong.fs +1 -1
- package/dist/assets/shaders/webgl1/Point.vs +1 -1
- package/dist/assets/shaders/webgl2/Depth.vs +29 -1
- package/dist/assets/shaders/webgl2/Gouraud.vs +32 -4
- package/dist/assets/shaders/webgl2/Line.fs +24 -12
- package/dist/assets/shaders/webgl2/Line.vs +36 -11
- package/dist/assets/shaders/webgl2/LineTransform.fs +4 -0
- package/dist/assets/shaders/webgl2/LineTransform.vs +57 -0
- package/dist/assets/shaders/webgl2/PBR.fs +1 -1
- package/dist/assets/shaders/webgl2/PBR.vs +35 -7
- package/dist/assets/shaders/webgl2/Phong.fs +1 -1
- package/dist/assets/shaders/webgl2/Phong.vs +31 -3
- package/dist/assets/shaders/webgl2/Point.vs +30 -2
- package/dist/assets/shaders/webgl2/Unlit.vs +31 -3
- package/dist/example.html +6 -6
- package/dist/x_ite.css +199 -224
- package/dist/x_ite.js +16335 -15917
- package/dist/x_ite.min.js +17 -17
- package/dist/x_ite.zip +0 -0
- package/docs/404.md +6 -0
- package/docs/Accessing-the-External-Browser.md +21 -15
- package/docs/Browser-Support.md +6 -0
- package/docs/Custom-Shaders.md +18 -25
- package/docs/Features.md +11 -5
- package/docs/Gemfile +44 -0
- package/docs/Gemfile.lock +122 -0
- package/docs/Glossary.md +6 -0
- package/docs/How-To-Configure-Your-Web-Server.md +6 -0
- package/docs/Supported-Nodes.md +9 -1
- package/docs/What's-New.md +93 -39
- package/docs/XHTML-DOM-Integration.md +6 -0
- package/docs/_config.yml +2 -2
- package/docs/assets/css/main.scss +26 -0
- package/docs/index.md +42 -50
- package/docs/reference/Browser-Services.md +9 -3
- package/docs/reference/Constants-Services.md +6 -0
- package/docs/reference/ECMAScript-Object-and-Function-Definitions.md +12 -6
- package/docs/reference/Field-Services-and-Objects.md +105 -1
- package/docs/reference/Prototype-Services.md +11 -0
- package/docs/reference/Route-Services.md +9 -0
- package/docs/reference/Scene-Services.md +17 -2
- package/docs/reference/Script-Node-Authoring-Interface.md +7 -1
- package/docs/tutorials/Adding-backgrounds.md +6 -0
- package/docs/tutorials/Adding-fog.md +6 -0
- package/docs/tutorials/Adding-sound.md +6 -0
- package/docs/tutorials/Animating-transforms.md +6 -0
- package/docs/tutorials/Basic-Nodes.md +6 -0
- package/docs/tutorials/Building-a-X3D-world.md +6 -0
- package/docs/tutorials/Building-elevation-grids.md +6 -0
- package/docs/tutorials/Building-extruded-shapes.md +6 -0
- package/docs/tutorials/Building-primitive-shapes.md +6 -0
- package/docs/tutorials/Building-shapes-out-of-points,-lines,-and-faces.md +6 -0
- package/docs/tutorials/Controlling-appearance-with-materials.md +6 -0
- package/docs/tutorials/Controlling-color-on-coordinate-based-geometry.md +6 -0
- package/docs/tutorials/Controlling-detail.md +6 -0
- package/docs/tutorials/Controlling-how-textures-are-mapped.md +6 -0
- package/docs/tutorials/Controlling-navigation.md +6 -0
- package/docs/tutorials/Controlling-shading-on-coordinate-based-geometry.md +6 -0
- package/docs/tutorials/Controlling-the-viewpoint.md +6 -0
- package/docs/tutorials/Creating-new-node-types.md +6 -0
- package/docs/tutorials/Grouping-nodes.md +6 -0
- package/docs/tutorials/Hello,-World!.md +6 -0
- package/docs/tutorials/Improving-Performance.md +6 -0
- package/docs/tutorials/Increasing-Rendering-Speed.md +6 -0
- package/docs/tutorials/Introducing-X3D.md +6 -0
- package/docs/tutorials/Introducing-animation.md +6 -0
- package/docs/tutorials/Introducing-script-use.md +6 -0
- package/docs/tutorials/Lighting-your-world.md +6 -0
- package/docs/tutorials/Mapping-textures.md +6 -0
- package/docs/tutorials/Naming-nodes.md +6 -0
- package/docs/tutorials/Providing-information-about-your-world.md +6 -0
- package/docs/tutorials/Sensing-the-viewer.md +6 -0
- package/docs/tutorials/Sensing-viewer-actions.md +6 -0
- package/docs/tutorials/Transforming-Shapes.md +6 -0
- package/docs/tutorials/Writing-program-scripts-with-ECMAScript.md +6 -0
- package/docs/tutorials/index.md +42 -36
- package/package.json +6 -7
- package/src/assets/components/geometry2d.js +1 -1
- package/src/assets/components/key-device-sensor.js +1 -1
- package/src/assets/components/layout.js +1 -1
- package/src/assets/components/particle-systems.js +1 -1
- package/src/assets/components/volume-rendering.js +1 -1
- package/src/assets/images/Shading.png +0 -0
- package/src/assets/linetype/1.png +0 -0
- package/src/assets/linetype/10.png +0 -0
- package/src/assets/linetype/11.png +0 -0
- package/src/assets/linetype/12.png +0 -0
- package/src/assets/linetype/13.png +0 -0
- package/src/assets/linetype/14.png +0 -0
- package/src/assets/linetype/15.png +0 -0
- package/src/assets/linetype/16.png +0 -0
- package/src/assets/linetype/2.png +0 -0
- package/src/assets/linetype/3.png +0 -0
- package/src/assets/linetype/4.png +0 -0
- package/src/assets/linetype/5.png +0 -0
- package/src/assets/linetype/6.png +0 -0
- package/src/assets/linetype/7.png +0 -0
- package/src/assets/linetype/8.png +0 -0
- package/src/assets/linetype/9.png +0 -0
- package/src/assets/shaders/Types.glsl +1 -9
- package/src/assets/shaders/webgl1/Gouraud.fs +1 -1
- package/src/assets/shaders/webgl1/Gouraud.vs +2 -3
- package/src/assets/shaders/webgl1/Line.fs +3 -28
- package/src/assets/shaders/webgl1/Line.vs +6 -20
- package/src/assets/shaders/webgl1/PBR.fs +6 -6
- package/src/assets/shaders/webgl1/PBR.vs +1 -1
- package/src/assets/shaders/webgl1/Phong.fs +10 -10
- package/src/assets/shaders/webgl1/Point.vs +2 -2
- package/src/assets/shaders/webgl1/Unlit.fs +4 -4
- package/src/assets/shaders/webgl1/include/Normal.glsl +1 -1
- package/src/assets/shaders/webgl1/include/Texture.glsl +3 -8
- package/src/assets/shaders/webgl2/Depth.vs +4 -1
- package/src/assets/shaders/webgl2/Gouraud.fs +1 -1
- package/src/assets/shaders/webgl2/Gouraud.vs +8 -6
- package/src/assets/shaders/webgl2/Line.fs +11 -17
- package/src/assets/shaders/webgl2/Line.vs +17 -21
- package/src/assets/shaders/webgl2/LineTransform.fs +6 -0
- package/src/assets/shaders/webgl2/LineTransform.vs +77 -0
- package/src/assets/shaders/webgl2/PBR.fs +6 -6
- package/src/assets/shaders/webgl2/PBR.vs +10 -7
- package/src/assets/shaders/webgl2/Phong.fs +11 -11
- package/src/assets/shaders/webgl2/Phong.vs +6 -3
- package/src/assets/shaders/webgl2/Point.vs +5 -4
- package/src/assets/shaders/webgl2/Unlit.fs +5 -5
- package/src/assets/shaders/webgl2/Unlit.vs +6 -3
- package/src/assets/shaders/webgl2/include/Line2.glsl +20 -0
- package/src/assets/shaders/webgl2/include/Normal.glsl +1 -1
- package/src/assets/shaders/webgl2/include/Particle.glsl +36 -0
- package/src/assets/shaders/webgl2/include/Texture.glsl +3 -3
- package/src/example.html +6 -6
- package/src/examples.js +5 -4
- package/src/standard/Math/Algorithm.js +12 -28
- package/src/standard/Math/Geometry/Line2.js +163 -0
- package/src/standard/Math/Geometry/Line3.js +3 -5
- package/src/standard/Math/Geometry/Plane3.js +0 -2
- package/src/standard/Math/Geometry/Triangle3.js +1 -1
- package/src/standard/Math/Geometry/ViewVolume.js +121 -103
- package/src/standard/Math/Numbers/Color3.js +6 -0
- package/src/standard/Math/Numbers/Color4.js +7 -0
- package/src/standard/Math/Numbers/Complex.js +48 -34
- package/src/standard/Math/Numbers/Matrix2.js +62 -2
- package/src/standard/Math/Numbers/Matrix3.js +129 -110
- package/src/standard/Math/Numbers/Matrix4.js +138 -119
- package/src/standard/Math/Numbers/Quaternion.js +12 -5
- package/src/standard/Math/Numbers/Rotation4.js +8 -1
- package/src/standard/Math/Numbers/Vector2.js +42 -9
- package/src/standard/Math/Numbers/Vector3.js +50 -14
- package/src/standard/Math/Numbers/Vector4.js +48 -11
- package/src/standard/Math/Utility/BVH.js +45 -17
- package/src/tests.js +68 -66
- package/src/x_ite/Base/X3DBaseNode.js +22 -11
- package/src/x_ite/Base/X3DField.js +1 -1
- package/src/x_ite/Browser/Core/BrowserOptions.js +24 -143
- package/src/x_ite/Browser/Core/BrowserTimings.js +6 -4
- package/src/x_ite/Browser/Core/Context.js +185 -0
- package/src/x_ite/Browser/Core/ContextMenu.js +398 -211
- package/src/x_ite/Browser/Core/Notification.js +1 -0
- package/src/x_ite/Browser/Core/X3DCoreContext.js +35 -146
- package/src/x_ite/Browser/Followers/X3DArrayFollowerTemplate.js +1 -1
- package/src/x_ite/Browser/Geometry2D/Disk2DOptions.js +1 -0
- package/src/x_ite/Browser/Geometry2D/X3DGeometry2DContext.js +2 -2
- package/src/x_ite/Browser/Geometry3D/X3DGeometry3DContext.js +41 -2
- package/src/x_ite/Browser/Geospatial/Geocentric.js +2 -2
- package/src/x_ite/Browser/Interpolation/CatmullRomSplineInterpolatorTemplate.js +1 -1
- package/src/x_ite/Browser/Layout/ScreenText.js +18 -65
- package/src/x_ite/Browser/Layout/X3DLayoutContext.js +59 -16
- package/src/x_ite/Browser/Navigation/ExamineViewer.js +13 -20
- package/src/x_ite/Browser/Navigation/LookAtViewer.js +1 -4
- package/src/x_ite/Browser/Navigation/PlaneViewer.js +0 -3
- package/src/x_ite/Browser/Navigation/X3DFlyViewer.js +15 -8
- package/src/x_ite/Browser/Navigation/X3DViewer.js +12 -20
- package/src/x_ite/Browser/Networking/X3DNetworkingContext.js +11 -7
- package/src/x_ite/Browser/ParticleSystems/BVH.glsl +183 -0
- package/src/x_ite/Browser/ParticleSystems/Box3.glsl +47 -0
- package/src/x_ite/Browser/ParticleSystems/GeometryTypes.js +66 -0
- package/src/x_ite/Browser/ParticleSystems/Line3.glsl +55 -0
- package/src/x_ite/Browser/ParticleSystems/Plane3.glsl +160 -0
- package/src/x_ite/Browser/PointingDeviceSensor/PointingDevice.js +27 -3
- package/src/x_ite/Browser/PointingDeviceSensor/X3DPointingDeviceSensorContext.js +41 -37
- package/src/x_ite/Browser/Rendering/X3DRenderingContext.js +21 -13
- package/src/x_ite/Browser/Shaders/Shader.js +33 -12
- package/src/x_ite/Browser/Shaders/ShaderSource.js +6 -0
- package/src/x_ite/Browser/Shaders/ShaderTest.js +16 -10
- package/src/x_ite/Browser/Shape/X3DShapeContext.js +50 -9
- package/src/x_ite/Browser/Text/X3DTextContext.js +4 -13
- package/src/x_ite/Browser/Text/X3DTextGeometry.js +2 -1
- package/src/x_ite/Browser/Texturing/X3DTexturingContext.js +71 -34
- package/src/x_ite/Browser/Texturing3D/DICOMParser.js +2 -2
- package/src/x_ite/Browser/Time/X3DTimeContext.js +4 -2
- package/src/x_ite/Browser/VERSION.js +1 -1
- package/src/x_ite/Browser/X3DBrowser.js +7 -6
- package/src/x_ite/Browser/X3DBrowserContext.js +43 -10
- package/src/x_ite/Components/Core/X3DNode.js +4 -0
- package/src/x_ite/Components/Core/X3DPrototypeInstance.js +0 -2
- package/src/x_ite/Components/CubeMapTexturing/ComposedCubeMapTexture.js +3 -4
- package/src/x_ite/Components/CubeMapTexturing/GeneratedCubeMapTexture.js +1 -12
- package/src/x_ite/Components/CubeMapTexturing/ImageCubeMapTexture.js +1 -2
- package/src/x_ite/Components/EnvironmentalEffects/TextureBackground.js +1 -1
- package/src/x_ite/Components/EnvironmentalEffects/X3DBackgroundNode.js +76 -77
- package/src/x_ite/Components/EnvironmentalEffects/X3DFogObject.js +2 -9
- package/src/x_ite/Components/EnvironmentalSensor/ProximitySensor.js +51 -65
- package/src/x_ite/Components/EventUtilities/X3DSequencerNode.js +1 -1
- package/src/x_ite/Components/Followers/ColorDamper.js +1 -1
- package/src/x_ite/Components/Followers/X3DChaserNode.js +18 -32
- package/src/x_ite/Components/Followers/X3DDamperNode.js +1 -6
- package/src/x_ite/Components/Followers/X3DFollowerNode.js +1 -1
- package/src/x_ite/Components/Geometry2D/Disk2D.js +30 -46
- package/src/x_ite/Components/Geometry2D/TriangleSet2D.js +1 -1
- package/src/x_ite/Components/Geometry3D/ElevationGrid.js +12 -4
- package/src/x_ite/Components/Geometry3D/IndexedFaceSet.js +4 -4
- package/src/x_ite/Components/Geospatial/GeoCoordinate.js +10 -27
- package/src/x_ite/Components/Geospatial/GeoLOD.js +1 -1
- package/src/x_ite/Components/Geospatial/GeoPositionInterpolator.js +5 -10
- package/src/x_ite/Components/Geospatial/GeoTouchSensor.js +9 -16
- package/src/x_ite/Components/Geospatial/GeoTransform.js +6 -18
- package/src/x_ite/Components/Geospatial/GeoViewpoint.js +26 -30
- package/src/x_ite/Components/Geospatial/X3DGeospatialObject.js +20 -27
- package/src/x_ite/Components/Grouping/X3DGroupingNode.js +8 -8
- package/src/x_ite/Components/Grouping/X3DTransformNode.js +0 -4
- package/src/x_ite/Components/HAnim/HAnimHumanoid.js +68 -75
- package/src/x_ite/Components/Interpolation/OrientationInterpolator.js +4 -11
- package/src/x_ite/Components/Interpolation/X3DInterpolatorNode.js +1 -1
- package/src/x_ite/Components/Layout/LayoutGroup.js +4 -9
- package/src/x_ite/Components/Layout/ScreenFontStyle.js +1 -1
- package/src/x_ite/Components/Layout/ScreenGroup.js +16 -80
- package/src/x_ite/Components/Lighting/DirectionalLight.js +28 -36
- package/src/x_ite/Components/Lighting/PointLight.js +32 -47
- package/src/x_ite/Components/Lighting/SpotLight.js +33 -48
- package/src/x_ite/Components/Navigation/Billboard.js +49 -56
- package/src/x_ite/Components/Navigation/LOD.js +2 -2
- package/src/x_ite/Components/Navigation/OrthoViewpoint.js +29 -30
- package/src/x_ite/Components/Navigation/Viewpoint.js +16 -20
- package/src/x_ite/Components/Navigation/X3DViewpointNode.js +82 -111
- package/src/x_ite/Components/Networking/Anchor.js +18 -7
- package/src/x_ite/Components/ParticleSystems/BoundedPhysicsModel.js +6 -6
- package/src/x_ite/Components/ParticleSystems/ConeEmitter.js +44 -36
- package/src/x_ite/Components/ParticleSystems/ExplosionEmitter.js +26 -17
- package/src/x_ite/Components/ParticleSystems/ForcePhysicsModel.js +20 -7
- package/src/x_ite/Components/ParticleSystems/ParticleSystem.js +463 -882
- package/src/x_ite/Components/ParticleSystems/PointEmitter.js +39 -35
- package/src/x_ite/Components/ParticleSystems/PolylineEmitter.js +112 -128
- package/src/x_ite/Components/ParticleSystems/SurfaceEmitter.js +105 -112
- package/src/x_ite/Components/ParticleSystems/VolumeEmitter.js +138 -176
- package/src/x_ite/Components/ParticleSystems/WindPhysicsModel.js +16 -11
- package/src/x_ite/Components/ParticleSystems/X3DParticleEmitterNode.js +807 -217
- package/src/x_ite/Components/Picking/LinePickSensor.js +31 -39
- package/src/x_ite/Components/PointingDeviceSensor/CylinderSensor.js +91 -108
- package/src/x_ite/Components/PointingDeviceSensor/PlaneSensor.js +56 -59
- package/src/x_ite/Components/PointingDeviceSensor/SphereSensor.js +54 -71
- package/src/x_ite/Components/PointingDeviceSensor/TouchSensor.js +8 -15
- package/src/x_ite/Components/ProjectiveTextureMapping/TextureProjectorParallel.js +43 -50
- package/src/x_ite/Components/ProjectiveTextureMapping/TextureProjectorPerspective.js +32 -39
- package/src/x_ite/Components/Rendering/ClipPlane.js +3 -11
- package/src/x_ite/Components/Rendering/Color.js +12 -24
- package/src/x_ite/Components/Rendering/ColorRGBA.js +13 -25
- package/src/x_ite/Components/Rendering/IndexedLineSet.js +26 -4
- package/src/x_ite/Components/Rendering/LineSet.js +35 -13
- package/src/x_ite/Components/Rendering/PointSet.js +35 -13
- package/src/x_ite/Components/Rendering/X3DComposedGeometryNode.js +13 -5
- package/src/x_ite/Components/Rendering/X3DGeometryNode.js +331 -387
- package/src/x_ite/Components/Rendering/X3DLineGeometryNode.js +350 -140
- package/src/x_ite/Components/Rendering/X3DPointGeometryNode.js +116 -126
- package/src/x_ite/Components/RigidBodyPhysics/DoubleAxisHingeJoint.js +24 -38
- package/src/x_ite/Components/RigidBodyPhysics/SingleAxisHingeJoint.js +10 -17
- package/src/x_ite/Components/Shaders/ComposedShader.js +35 -75
- package/src/x_ite/Components/Shaders/FloatVertexAttribute.js +8 -11
- package/src/x_ite/Components/Shaders/Matrix3VertexAttribute.js +10 -14
- package/src/x_ite/Components/Shaders/Matrix4VertexAttribute.js +10 -14
- package/src/x_ite/Components/Shaders/ShaderPart.js +1 -10
- package/src/x_ite/Components/Shaders/X3DProgrammableShaderObject.js +220 -210
- package/src/x_ite/Components/Shaders/X3DShaderNode.js +28 -10
- package/src/x_ite/Components/Shaders/X3DVertexAttributeNode.js +15 -1
- package/src/x_ite/Components/Shape/Appearance.js +37 -4
- package/src/x_ite/Components/Shape/FillProperties.js +12 -1
- package/src/x_ite/Components/Shape/LineProperties.js +33 -1
- package/src/x_ite/Components/Shape/PointProperties.js +24 -3
- package/src/x_ite/Components/Shape/Shape.js +30 -39
- package/src/x_ite/Components/Shape/TwoSidedMaterial.js +3 -1
- package/src/x_ite/Components/Sound/Sound.js +31 -41
- package/src/x_ite/Components/Text/Text.js +6 -20
- package/src/x_ite/Components/Texturing/ImageTexture.js +1 -1
- package/src/x_ite/Components/Texturing/MovieTexture.js +1 -1
- package/src/x_ite/Components/Texturing/PixelTexture.js +2 -2
- package/src/x_ite/Components/Texturing/TextureCoordinate.js +5 -5
- package/src/x_ite/Components/Texturing/TextureProperties.js +4 -4
- package/src/x_ite/Components/Texturing/X3DSingleTextureNode.js +5 -4
- package/src/x_ite/Components/Texturing/X3DTexture2DNode.js +24 -33
- package/src/x_ite/Components/Texturing3D/TextureCoordinate3D.js +5 -5
- package/src/x_ite/Components/Texturing3D/TextureCoordinate4D.js +5 -5
- package/src/x_ite/Components/Texturing3D/X3DTexture3DNode.js +12 -19
- package/src/x_ite/Components/VolumeRendering/X3DVolumeDataNode.js +8 -8
- package/src/x_ite/Components.js +2 -2
- package/src/x_ite/Fallback.js +9 -3
- package/src/x_ite/Fields/SFColor.js +4 -0
- package/src/x_ite/Fields/SFColorRGBA.js +4 -0
- package/src/x_ite/Fields/SFImage.js +2 -11
- package/src/x_ite/Fields/SFMatrixPrototypeTemplate.js +4 -0
- package/src/x_ite/Fields/SFRotation.js +4 -0
- package/src/x_ite/Fields/SFString.js +4 -0
- package/src/x_ite/Fields/SFVecPrototypeTemplate.js +22 -2
- package/src/x_ite/Parser/XMLParser.js +1 -1
- package/src/x_ite/Rendering/TextureBuffer.js +43 -36
- package/src/x_ite/Rendering/VertexArray.js +103 -0
- package/src/x_ite/Rendering/X3DRenderObject.js +127 -148
- package/src/x_ite/X3D.js +32 -26
- package/src/x_ite.config.js +0 -5
- package/src/x_ite.css +216 -175
- package/src/x_ite.html +15 -10
- package/src/x_ite.js +49 -1
- package/x_ite.min.html +15 -10
- package/dist/assets/hatching/0.png +0 -0
- package/dist/assets/linetype/0.png +0 -0
- package/src/assets/hatching/0.png +0 -0
- package/src/assets/linetype/0.png +0 -0
- package/src/spinner.css +0 -67
- package/src/x_ite/Browser/Shape/LineStipples.xcf +0 -0
|
@@ -4,16 +4,17 @@
|
|
|
4
4
|
|
|
5
5
|
precision highp float;
|
|
6
6
|
precision highp int;
|
|
7
|
+
precision highp sampler2D;
|
|
7
8
|
|
|
8
9
|
uniform mat4 x3d_ProjectionMatrix;
|
|
9
10
|
uniform mat4 x3d_ModelViewMatrix;
|
|
10
11
|
uniform mat3 x3d_NormalMatrix;
|
|
11
12
|
|
|
12
|
-
in vec4
|
|
13
|
-
in vec3 x3d_Normal;
|
|
13
|
+
in vec4 x3d_Color;
|
|
14
14
|
in vec4 x3d_TexCoord0;
|
|
15
15
|
in vec4 x3d_TexCoord1;
|
|
16
|
-
in
|
|
16
|
+
in vec3 x3d_Normal;
|
|
17
|
+
in vec4 x3d_Vertex;
|
|
17
18
|
|
|
18
19
|
out vec3 vertex;
|
|
19
20
|
out vec3 normal;
|
|
@@ -27,15 +28,17 @@ out vec3 localVertex; // point on geometry in local coordinates
|
|
|
27
28
|
out float depth;
|
|
28
29
|
#endif
|
|
29
30
|
|
|
31
|
+
#pragma X3D include "include/Particle.glsl"
|
|
32
|
+
|
|
30
33
|
void
|
|
31
34
|
main ()
|
|
32
35
|
{
|
|
33
|
-
vec4 position = x3d_ModelViewMatrix * x3d_Vertex;
|
|
36
|
+
vec4 position = x3d_ModelViewMatrix * getVertex (x3d_Vertex);
|
|
34
37
|
|
|
35
38
|
vertex = position .xyz;
|
|
36
|
-
normal =
|
|
37
|
-
texCoord0 = x3d_TexCoord0;
|
|
38
|
-
texCoord1 = x3d_TexCoord1;
|
|
39
|
+
normal = x3d_NormalMatrix * x3d_Normal;
|
|
40
|
+
texCoord0 = getTexCoord (x3d_TexCoord0);
|
|
41
|
+
texCoord1 = getTexCoord (x3d_TexCoord1);
|
|
39
42
|
color = x3d_Color;
|
|
40
43
|
localNormal = x3d_Normal;
|
|
41
44
|
localVertex = x3d_Vertex .xyz;
|
|
@@ -4,8 +4,8 @@ precision highp float;
|
|
|
4
4
|
precision highp int;
|
|
5
5
|
|
|
6
6
|
uniform int x3d_GeometryType;
|
|
7
|
-
uniform bool x3d_ColorMaterial; // true if a X3DColorNode is attached, otherwise false
|
|
8
7
|
uniform float x3d_AlphaCutoff;
|
|
8
|
+
uniform bool x3d_ColorMaterial; // true if a X3DColorNode is attached, otherwise false
|
|
9
9
|
|
|
10
10
|
uniform int x3d_NumLights;
|
|
11
11
|
uniform x3d_LightSourceParameters x3d_LightSource [x3d_MaxLights];
|
|
@@ -60,7 +60,7 @@ getAmbientColor (in vec3 diffuseColor)
|
|
|
60
60
|
// Get texture color.
|
|
61
61
|
|
|
62
62
|
#if defined(X3D_AMBIENT_TEXTURE)
|
|
63
|
-
|
|
63
|
+
vec3 texCoord = getTexCoord (x3d_AmbientTexture .textureTransformMapping, x3d_AmbientTexture .textureCoordinateMapping);
|
|
64
64
|
|
|
65
65
|
#if defined(X3D_AMBIENT_TEXTURE_2D)
|
|
66
66
|
return ambientParameter * texture (x3d_AmbientTexture .texture2D, texCoord .st) .rgb;
|
|
@@ -85,14 +85,14 @@ getDiffuseColor ()
|
|
|
85
85
|
// Get texture color.
|
|
86
86
|
|
|
87
87
|
#if defined(X3D_DIFFUSE_TEXTURE)
|
|
88
|
-
|
|
88
|
+
vec3 texCoord = getTexCoord (x3d_DiffuseTexture .textureTransformMapping, x3d_DiffuseTexture .textureCoordinateMapping);
|
|
89
89
|
|
|
90
90
|
#if defined(X3D_DIFFUSE_TEXTURE_2D)
|
|
91
|
-
return diffuseParameter * texture (x3d_DiffuseTexture .texture2D, texCoord .st)
|
|
91
|
+
return diffuseParameter * texture (x3d_DiffuseTexture .texture2D, texCoord .st);
|
|
92
92
|
#elif defined(X3D_DIFFUSE_TEXTURE_3D)
|
|
93
|
-
return diffuseParameter * texture (x3d_DiffuseTexture .texture3D, texCoord .stp)
|
|
93
|
+
return diffuseParameter * texture (x3d_DiffuseTexture .texture3D, texCoord .stp);
|
|
94
94
|
#elif defined(X3D_DIFFUSE_TEXTURE_CUBE)
|
|
95
|
-
return diffuseParameter * texture (x3d_DiffuseTexture .textureCube, texCoord .stp)
|
|
95
|
+
return diffuseParameter * texture (x3d_DiffuseTexture .textureCube, texCoord .stp);
|
|
96
96
|
#endif
|
|
97
97
|
#else
|
|
98
98
|
return getTextureColor (diffuseParameter, vec4 (x3d_Material .specularColor, alpha));
|
|
@@ -109,7 +109,7 @@ getSpecularColor ()
|
|
|
109
109
|
// Get texture color.
|
|
110
110
|
|
|
111
111
|
#if defined(X3D_SPECULAR_TEXTURE)
|
|
112
|
-
|
|
112
|
+
vec3 texCoord = getTexCoord (x3d_SpecularTexture .textureTransformMapping, x3d_SpecularTexture .textureCoordinateMapping);
|
|
113
113
|
|
|
114
114
|
#if defined(X3D_SPECULAR_TEXTURE_2D)
|
|
115
115
|
return specularParameter * texture (x3d_SpecularTexture .texture2D, texCoord .st) .rgb;
|
|
@@ -133,7 +133,7 @@ getEmissiveColor ()
|
|
|
133
133
|
// Get texture color.
|
|
134
134
|
|
|
135
135
|
#if defined(X3D_EMISSIVE_TEXTURE)
|
|
136
|
-
|
|
136
|
+
vec3 texCoord = getTexCoord (x3d_EmissiveTexture .textureTransformMapping, x3d_EmissiveTexture .textureCoordinateMapping);
|
|
137
137
|
|
|
138
138
|
#if defined(X3D_EMISSIVE_TEXTURE_2D)
|
|
139
139
|
return emissiveParameter * texture (x3d_EmissiveTexture .texture2D, texCoord .st) .rgb;
|
|
@@ -157,7 +157,7 @@ getShininessFactor ()
|
|
|
157
157
|
// Get texture color.
|
|
158
158
|
|
|
159
159
|
#if defined(X3D_SHININESS_TEXTURE)
|
|
160
|
-
|
|
160
|
+
vec3 texCoord = getTexCoord (x3d_ShininessTexture .textureTransformMapping, x3d_ShininessTexture .textureCoordinateMapping);
|
|
161
161
|
|
|
162
162
|
#if defined(X3D_SHININESS_TEXTURE_2D)
|
|
163
163
|
return shininess * texture (x3d_ShininessTexture .texture2D, texCoord .st) .a * 128.0;
|
|
@@ -177,7 +177,7 @@ getOcclusionFactor ()
|
|
|
177
177
|
// Get texture color.
|
|
178
178
|
|
|
179
179
|
#if defined(X3D_OCCLUSION_TEXTURE)
|
|
180
|
-
|
|
180
|
+
vec3 texCoord = getTexCoord (x3d_OcclusionTexture .textureTransformMapping, x3d_OcclusionTexture .textureCoordinateMapping);
|
|
181
181
|
|
|
182
182
|
#if defined(X3D_OCCLUSION_TEXTURE_2D)
|
|
183
183
|
return texture (x3d_OcclusionTexture .texture2D, texCoord .st) .r;
|
|
@@ -240,7 +240,7 @@ getMaterialColor ()
|
|
|
240
240
|
float specularFactor = shininessFactor > 0.0 ? pow (max (dot (N, H), 0.0), shininessFactor) : 1.0;
|
|
241
241
|
vec3 specularTerm = specularColor * specularFactor;
|
|
242
242
|
|
|
243
|
-
float attenuationFactor = di ? 1.0 : 1.0 / max (c
|
|
243
|
+
float attenuationFactor = di ? 1.0 : 1.0 / max (dot (c, vec3 (1.0, dL, dL * dL)), 1.0);
|
|
244
244
|
float spotFactor = light .type == x3d_SpotLight ? getSpotFactor (light .cutOffAngle, light .beamWidth, L, d) : 1.0;
|
|
245
245
|
float attenuationSpotFactor = attenuationFactor * spotFactor;
|
|
246
246
|
vec3 ambientTerm = light .ambientIntensity * ambientColor;
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
precision highp float;
|
|
4
4
|
precision highp int;
|
|
5
|
+
precision highp sampler2D;
|
|
5
6
|
|
|
6
7
|
uniform mat3 x3d_NormalMatrix;
|
|
7
8
|
uniform mat4 x3d_ProjectionMatrix;
|
|
@@ -39,10 +40,12 @@ out vec4 texCoord1; // texCoord1
|
|
|
39
40
|
out float depth;
|
|
40
41
|
#endif
|
|
41
42
|
|
|
43
|
+
#pragma X3D include "include/Particle.glsl"
|
|
44
|
+
|
|
42
45
|
void
|
|
43
46
|
main ()
|
|
44
47
|
{
|
|
45
|
-
vec4 position = x3d_ModelViewMatrix * x3d_Vertex;
|
|
48
|
+
vec4 position = x3d_ModelViewMatrix * getVertex (x3d_Vertex);
|
|
46
49
|
|
|
47
50
|
fogDepth = x3d_FogDepth;
|
|
48
51
|
color = x3d_Color;
|
|
@@ -52,11 +55,11 @@ main ()
|
|
|
52
55
|
localVertex = x3d_Vertex .xyz;
|
|
53
56
|
|
|
54
57
|
#if x3d_MaxTextures > 0
|
|
55
|
-
texCoord0 = x3d_TexCoord0;
|
|
58
|
+
texCoord0 = getTexCoord (x3d_TexCoord0);
|
|
56
59
|
#endif
|
|
57
60
|
|
|
58
61
|
#if x3d_MaxTextures > 1
|
|
59
|
-
texCoord1 = x3d_TexCoord1;
|
|
62
|
+
texCoord1 = getTexCoord (x3d_TexCoord1);
|
|
60
63
|
#endif
|
|
61
64
|
|
|
62
65
|
gl_Position = x3d_ProjectionMatrix * position;
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
precision highp float;
|
|
4
4
|
precision highp int;
|
|
5
|
+
precision highp sampler2D;
|
|
5
6
|
|
|
6
7
|
uniform x3d_PointPropertiesParameters x3d_PointProperties;
|
|
7
8
|
|
|
@@ -25,12 +26,12 @@ out vec3 vertex; // point on geometry
|
|
|
25
26
|
out float depth;
|
|
26
27
|
#endif
|
|
27
28
|
|
|
29
|
+
#pragma X3D include "include/Particle.glsl"
|
|
30
|
+
|
|
28
31
|
void
|
|
29
32
|
main ()
|
|
30
33
|
{
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
vec4 position = x3d_ModelViewMatrix * x3d_Vertex;
|
|
34
|
+
vec4 position = x3d_ModelViewMatrix * getVertex (x3d_Vertex);
|
|
34
35
|
|
|
35
36
|
fogDepth = x3d_FogDepth;
|
|
36
37
|
vertex = position .xyz;
|
|
@@ -49,7 +50,7 @@ main ()
|
|
|
49
50
|
float dL = length (vertex);
|
|
50
51
|
|
|
51
52
|
pointSize = x3d_PointProperties .pointSizeScaleFactor;
|
|
52
|
-
pointSize
|
|
53
|
+
pointSize /= dot (pointSizeAttenuation, vec3 (1.0, dL, dL * dL));
|
|
53
54
|
pointSize = clamp (pointSize, pointSizeMinValue, pointSizeMaxValue);
|
|
54
55
|
|
|
55
56
|
gl_PointSize = pointSize > 1.0 && x3d_NumTextures == 0 ? pointSize + 1.0 : pointSize;
|
|
@@ -5,8 +5,8 @@ precision highp int;
|
|
|
5
5
|
precision highp sampler3D;
|
|
6
6
|
|
|
7
7
|
uniform int x3d_GeometryType;
|
|
8
|
-
uniform bool x3d_ColorMaterial; // true if a X3DColorNode is attached, otherwise false
|
|
9
8
|
uniform float x3d_AlphaCutoff;
|
|
9
|
+
uniform bool x3d_ColorMaterial; // true if a X3DColorNode is attached, otherwise false
|
|
10
10
|
|
|
11
11
|
uniform x3d_UnlitMaterialParameters x3d_Material;
|
|
12
12
|
|
|
@@ -52,14 +52,14 @@ getEmissiveColor ()
|
|
|
52
52
|
// Get texture color.
|
|
53
53
|
|
|
54
54
|
#if defined(X3D_EMISSIVE_TEXTURE)
|
|
55
|
-
|
|
55
|
+
vec3 texCoord = getTexCoord (x3d_EmissiveTexture .textureTransformMapping, x3d_EmissiveTexture .textureCoordinateMapping);
|
|
56
56
|
|
|
57
57
|
#if defined(X3D_EMISSIVE_TEXTURE_2D)
|
|
58
|
-
return emissiveParameter * texture (x3d_EmissiveTexture .texture2D, texCoord .st)
|
|
58
|
+
return emissiveParameter * texture (x3d_EmissiveTexture .texture2D, texCoord .st);
|
|
59
59
|
#elif defined(X3D_EMISSIVE_TEXTURE_3D)
|
|
60
|
-
return emissiveParameter * texture (x3d_EmissiveTexture .texture3D, texCoord .stp)
|
|
60
|
+
return emissiveParameter * texture (x3d_EmissiveTexture .texture3D, texCoord .stp);
|
|
61
61
|
#elif defined(X3D_EMISSIVE_TEXTURE_CUBE)
|
|
62
|
-
return emissiveParameter * texture (x3d_EmissiveTexture .textureCube, texCoord .stp)
|
|
62
|
+
return emissiveParameter * texture (x3d_EmissiveTexture .textureCube, texCoord .stp);
|
|
63
63
|
#endif
|
|
64
64
|
#else
|
|
65
65
|
return getTextureColor (emissiveParameter, vec4 (vec3 (1.0), alpha));
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
precision highp float;
|
|
4
4
|
precision highp int;
|
|
5
|
+
precision highp sampler2D;
|
|
5
6
|
|
|
6
7
|
uniform mat3 x3d_NormalMatrix;
|
|
7
8
|
uniform mat4 x3d_ProjectionMatrix;
|
|
@@ -39,10 +40,12 @@ out vec4 texCoord1; // texCoord1
|
|
|
39
40
|
out float depth;
|
|
40
41
|
#endif
|
|
41
42
|
|
|
43
|
+
#pragma X3D include "include/Particle.glsl"
|
|
44
|
+
|
|
42
45
|
void
|
|
43
46
|
main ()
|
|
44
47
|
{
|
|
45
|
-
vec4 position = x3d_ModelViewMatrix * x3d_Vertex;
|
|
48
|
+
vec4 position = x3d_ModelViewMatrix * getVertex (x3d_Vertex);
|
|
46
49
|
|
|
47
50
|
fogDepth = x3d_FogDepth;
|
|
48
51
|
color = x3d_Color;
|
|
@@ -52,11 +55,11 @@ main ()
|
|
|
52
55
|
localVertex = x3d_Vertex .xyz;
|
|
53
56
|
|
|
54
57
|
#if x3d_MaxTextures > 0
|
|
55
|
-
texCoord0 = x3d_TexCoord0;
|
|
58
|
+
texCoord0 = getTexCoord (x3d_TexCoord0);
|
|
56
59
|
#endif
|
|
57
60
|
|
|
58
61
|
#if x3d_MaxTextures > 1
|
|
59
|
-
texCoord1 = x3d_TexCoord1;
|
|
62
|
+
texCoord1 = getTexCoord (x3d_TexCoord1);
|
|
60
63
|
#endif
|
|
61
64
|
|
|
62
65
|
gl_Position = x3d_ProjectionMatrix * position;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
struct Line2
|
|
2
|
+
{
|
|
3
|
+
vec2 point;
|
|
4
|
+
vec2 direction;
|
|
5
|
+
};
|
|
6
|
+
|
|
7
|
+
Line2
|
|
8
|
+
line2 (const in vec2 point1, const in vec2 point2)
|
|
9
|
+
{
|
|
10
|
+
return Line2 (point1, normalize (point2 - point1));
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
vec2
|
|
14
|
+
closest_point (const in Line2 line, const in vec2 point)
|
|
15
|
+
{
|
|
16
|
+
vec2 r = point - line .point;
|
|
17
|
+
float d = dot (r, line .direction);
|
|
18
|
+
|
|
19
|
+
return line .direction * d + line .point;
|
|
20
|
+
}
|
|
@@ -27,7 +27,7 @@ getNormalVector ()
|
|
|
27
27
|
// Get normal vector.
|
|
28
28
|
|
|
29
29
|
#if defined(X3D_NORMAL_TEXTURE)
|
|
30
|
-
|
|
30
|
+
vec3 texCoord = getTexCoord (x3d_NormalTexture .textureTransformMapping, x3d_NormalTexture .textureCoordinateMapping);
|
|
31
31
|
vec3 normalScale = vec3 (vec2 (x3d_Material .normalScale), 1.0);
|
|
32
32
|
mat3 tbn = getTBNMatrix (texCoord .st);
|
|
33
33
|
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
in vec4 x3d_Particle;
|
|
2
|
+
in mat4 x3d_ParticleMatrix;
|
|
3
|
+
|
|
4
|
+
uniform sampler2D x3d_TexCoordRamp;
|
|
5
|
+
|
|
6
|
+
vec4
|
|
7
|
+
texelFetch (const in sampler2D sampler, const in int index, const in int lod)
|
|
8
|
+
{
|
|
9
|
+
int x = textureSize (sampler, lod) .x;
|
|
10
|
+
ivec2 p = ivec2 (index % x, index / x);
|
|
11
|
+
vec4 t = texelFetch (sampler, p, lod);
|
|
12
|
+
|
|
13
|
+
return t;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
vec4
|
|
17
|
+
getVertex (const in vec4 vertex)
|
|
18
|
+
{
|
|
19
|
+
if (x3d_Particle [0] == 0.0)
|
|
20
|
+
return vertex;
|
|
21
|
+
|
|
22
|
+
return x3d_ParticleMatrix * vertex;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
vec4
|
|
26
|
+
getTexCoord (const in vec4 texCoord)
|
|
27
|
+
{
|
|
28
|
+
int index0 = int (x3d_Particle [3]);
|
|
29
|
+
|
|
30
|
+
if (x3d_Particle [0] == 0.0 || index0 == -1)
|
|
31
|
+
return texCoord;
|
|
32
|
+
|
|
33
|
+
const int map [6] = int [6] (0, 1, 2, 0, 2, 3);
|
|
34
|
+
|
|
35
|
+
return texelFetch (x3d_TexCoordRamp, index0 + map [gl_VertexID % 6], 0);
|
|
36
|
+
}
|
|
@@ -131,7 +131,7 @@ getTexCoord (const in x3d_TextureCoordinateGeneratorParameters textureCoordinate
|
|
|
131
131
|
}
|
|
132
132
|
}
|
|
133
133
|
|
|
134
|
-
|
|
134
|
+
vec3
|
|
135
135
|
getTexCoord (const in int textureTransformMapping, const in int textureCoordinateMapping)
|
|
136
136
|
{
|
|
137
137
|
vec4 texCoord = getTexCoord (x3d_TextureCoordinateGenerator [textureCoordinateMapping], textureTransformMapping, textureCoordinateMapping);
|
|
@@ -141,7 +141,7 @@ getTexCoord (const in int textureTransformMapping, const in int textureCoordinat
|
|
|
141
141
|
if ((x3d_GeometryType == x3d_Geometry2D) && (gl_FrontFacing == false))
|
|
142
142
|
texCoord .s = 1.0 - texCoord .s;
|
|
143
143
|
|
|
144
|
-
return texCoord;
|
|
144
|
+
return texCoord .stp;
|
|
145
145
|
}
|
|
146
146
|
|
|
147
147
|
vec4
|
|
@@ -228,7 +228,7 @@ getTextureColor (const in vec4 diffuseColor, const in vec4 specularColor)
|
|
|
228
228
|
|
|
229
229
|
// Get texture color.
|
|
230
230
|
|
|
231
|
-
|
|
231
|
+
vec3 texCoord = getTexCoord (i, i);
|
|
232
232
|
vec4 textureColor = vec4 (1.0);
|
|
233
233
|
|
|
234
234
|
switch (x3d_TextureType [i])
|
package/src/example.html
CHANGED
|
@@ -2,19 +2,19 @@
|
|
|
2
2
|
<html>
|
|
3
3
|
<head>
|
|
4
4
|
<meta charset="utf-8"/>
|
|
5
|
-
<
|
|
6
|
-
<script type="text/javascript" src="https://create3000.github.io/code/x_ite/latest/dist/x_ite.min.js"></script>
|
|
5
|
+
<script type="text/javascript" src="x_ite.min.js"></script>
|
|
6
|
+
<!-- <script type="text/javascript" src="https://create3000.github.io/code/x_ite/latest/dist/x_ite.min.js"></script> -->
|
|
7
7
|
<style>
|
|
8
|
-
|
|
8
|
+
x3d-canvas {
|
|
9
9
|
width: 1000px;
|
|
10
10
|
height: 563px;
|
|
11
11
|
}
|
|
12
12
|
</style>
|
|
13
13
|
</head>
|
|
14
14
|
<body>
|
|
15
|
-
<
|
|
15
|
+
<x3d-canvas src="https://create3000.github.io/media/x_ite/info/info.x3d">
|
|
16
16
|
<p>Your browser may not support all features required by X_ITE!</p>
|
|
17
|
-
</
|
|
18
|
-
<p>If
|
|
17
|
+
</x3d-canvas>
|
|
18
|
+
<p>If local files are not loaded <a href="https://create3000.github.io/x_ite/#using-firefox-chrome-and-opera-with-local-files">consider setup a localhost server</a>.</p>
|
|
19
19
|
</body>
|
|
20
20
|
</html>
|
package/src/examples.js
CHANGED
|
@@ -52,9 +52,6 @@ const X_ITE_EXAMPLES = [
|
|
|
52
52
|
{ component: "Lighting", test: "PointLight" },
|
|
53
53
|
{ component: "Lighting", test: "Shadows" },
|
|
54
54
|
{ component: "Lighting", test: "SpotLight" },
|
|
55
|
-
{ component: "NURBS", test: "NurbsCurve" },
|
|
56
|
-
{ component: "NURBS", test: "NurbsPatchSurface" },
|
|
57
|
-
{ component: "NURBS", test: "NurbsSweptSurface" },
|
|
58
55
|
{ component: "Navigation", test: "Billboard" },
|
|
59
56
|
{ component: "Navigation", test: "Collision" },
|
|
60
57
|
{ component: "Navigation", test: "LogarithmicDepthBuffer" },
|
|
@@ -64,6 +61,9 @@ const X_ITE_EXAMPLES = [
|
|
|
64
61
|
{ component: "Networking", test: "Anchor" },
|
|
65
62
|
{ component: "Networking", test: "Inline" },
|
|
66
63
|
{ component: "Networking", test: "LoadSensor" },
|
|
64
|
+
{ component: "NURBS", test: "NurbsCurve" },
|
|
65
|
+
{ component: "NURBS", test: "NurbsPatchSurface" },
|
|
66
|
+
{ component: "NURBS", test: "NurbsSweptSurface" },
|
|
67
67
|
{ component: "ParticleSystems", test: "ConeEmitter" },
|
|
68
68
|
{ component: "ParticleSystems", test: "ExplosionEmitter" },
|
|
69
69
|
{ component: "ParticleSystems", test: "ForcePhysicsModel" },
|
|
@@ -122,8 +122,8 @@ const X_ITE_EXAMPLES = [
|
|
|
122
122
|
{ component: "X3D", test: "Approach" },
|
|
123
123
|
{ component: "X3D", test: "Arcadia" },
|
|
124
124
|
{ component: "X3D", test: "Astronomy" },
|
|
125
|
-
{ component: "X3D", test: "BIC" },
|
|
126
125
|
{ component: "X3D", test: "BeyondGermany" },
|
|
126
|
+
{ component: "X3D", test: "BIC" },
|
|
127
127
|
{ component: "X3D", test: "Chomp" },
|
|
128
128
|
{ component: "X3D", test: "Circles" },
|
|
129
129
|
{ component: "X3D", test: "CrazySpiral" },
|
|
@@ -148,3 +148,4 @@ const X_ITE_EXAMPLES = [
|
|
|
148
148
|
{ component: "X_ITE", test: "BlendMode" },
|
|
149
149
|
];
|
|
150
150
|
X_ITE_EXAMPLES .server = "https://create3000.github.io/media/examples";
|
|
151
|
+
|
|
@@ -70,7 +70,7 @@ define (function ()
|
|
|
70
70
|
},
|
|
71
71
|
fract: function (value)
|
|
72
72
|
{
|
|
73
|
-
return value
|
|
73
|
+
return value % 1;
|
|
74
74
|
},
|
|
75
75
|
clamp: function (value, min, max)
|
|
76
76
|
{
|
|
@@ -96,23 +96,21 @@ define (function ()
|
|
|
96
96
|
{
|
|
97
97
|
let cosom = source .dot (destination);
|
|
98
98
|
|
|
99
|
-
if (cosom <= -1)
|
|
100
|
-
throw new Error ("slerp is not possible: vectors are inverse collinear.");
|
|
99
|
+
// if (cosom <= -1) ... vectors are inverse colinear.
|
|
101
100
|
|
|
102
|
-
if (cosom >= 1) //
|
|
101
|
+
if (cosom >= 1) // Both normal vectors are equal.
|
|
103
102
|
return source;
|
|
104
103
|
|
|
105
104
|
if (cosom < 0)
|
|
106
105
|
{
|
|
107
|
-
// Reverse signs so we travel the short way round
|
|
106
|
+
// Reverse signs so we travel the short way round.
|
|
108
107
|
cosom = -cosom;
|
|
109
108
|
destination .negate ();
|
|
110
109
|
}
|
|
111
110
|
|
|
112
111
|
const
|
|
113
|
-
omega
|
|
114
|
-
sinom
|
|
115
|
-
|
|
112
|
+
omega = Math .acos (cosom),
|
|
113
|
+
sinom = Math .sin (omega),
|
|
116
114
|
scale0 = Math .sin ((1 - t) * omega) / sinom,
|
|
117
115
|
scale1 = Math .sin (t * omega) / sinom;
|
|
118
116
|
|
|
@@ -127,16 +125,14 @@ define (function ()
|
|
|
127
125
|
{
|
|
128
126
|
const cosom = source .dot (destination);
|
|
129
127
|
|
|
130
|
-
if (cosom <= -1)
|
|
131
|
-
throw new Error ("slerp is not possible: vectors are inverse collinear.");
|
|
128
|
+
// if (cosom <= -1) ... vectors are inverse colinear.
|
|
132
129
|
|
|
133
|
-
if (cosom >= 1) //
|
|
130
|
+
if (cosom >= 1) // Both normal vectors are equal.
|
|
134
131
|
return source;
|
|
135
132
|
|
|
136
133
|
const
|
|
137
|
-
omega
|
|
138
|
-
sinom
|
|
139
|
-
|
|
134
|
+
omega = Math .acos (cosom),
|
|
135
|
+
sinom = Math .sin (omega),
|
|
140
136
|
scale0 = Math .sin ((1 - t) * omega) / sinom,
|
|
141
137
|
scale1 = Math .sin (t * omega) / sinom;
|
|
142
138
|
|
|
@@ -172,7 +168,7 @@ define (function ()
|
|
|
172
168
|
{
|
|
173
169
|
return lhs > rhs;
|
|
174
170
|
},
|
|
175
|
-
lowerBound: function (array, first, last, value, comp)
|
|
171
|
+
lowerBound: function (array, first, last, value, comp = this .less)
|
|
176
172
|
{
|
|
177
173
|
// http://en.cppreference.com/w/cpp/algorithm/lower_bound
|
|
178
174
|
|
|
@@ -197,7 +193,7 @@ define (function ()
|
|
|
197
193
|
|
|
198
194
|
return first;
|
|
199
195
|
},
|
|
200
|
-
upperBound: function (array, first, last, value, comp)
|
|
196
|
+
upperBound: function (array, first, last, value, comp = this .less)
|
|
201
197
|
{
|
|
202
198
|
// http://en.cppreference.com/w/cpp/algorithm/upper_bound
|
|
203
199
|
|
|
@@ -233,18 +229,6 @@ define (function ()
|
|
|
233
229
|
result .add (key);
|
|
234
230
|
}
|
|
235
231
|
|
|
236
|
-
return result;
|
|
237
|
-
},
|
|
238
|
-
map_difference: function (lhs, rhs, result)
|
|
239
|
-
{
|
|
240
|
-
for (const [key, value] of lhs)
|
|
241
|
-
{
|
|
242
|
-
if (rhs .has (key))
|
|
243
|
-
continue;
|
|
244
|
-
|
|
245
|
-
result .set (key, value);
|
|
246
|
-
}
|
|
247
|
-
|
|
248
232
|
return result;
|
|
249
233
|
},
|
|
250
234
|
};
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
/* -*- Mode: JavaScript; coding: utf-8; tab-width: 3; indent-tabs-mode: tab; c-basic-offset: 3 -*-
|
|
2
|
+
*******************************************************************************
|
|
3
|
+
*
|
|
4
|
+
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
5
|
+
*
|
|
6
|
+
* Copyright create3000, Scheffelstraße 31a, Leipzig, Germany 2011.
|
|
7
|
+
*
|
|
8
|
+
* All rights reserved. Holger Seelig <holger.seelig@yahoo.de>.
|
|
9
|
+
*
|
|
10
|
+
* The copyright notice above does not evidence any actual of intended
|
|
11
|
+
* publication of such source code, and is an unpublished work by create3000.
|
|
12
|
+
* This material contains CONFIDENTIAL INFORMATION that is the property of
|
|
13
|
+
* create3000.
|
|
14
|
+
*
|
|
15
|
+
* No permission is granted to copy, distribute, or create derivative works from
|
|
16
|
+
* the contents of this software, in whole or in part, without the prior written
|
|
17
|
+
* permission of create3000.
|
|
18
|
+
*
|
|
19
|
+
* NON-MILITARY USE ONLY
|
|
20
|
+
*
|
|
21
|
+
* All create3000 software are effectively free software with a non-military use
|
|
22
|
+
* restriction. It is free. Well commented source is provided. You may reuse the
|
|
23
|
+
* source in any way you please with the exception anything that uses it must be
|
|
24
|
+
* marked to indicate is contains 'non-military use only' components.
|
|
25
|
+
*
|
|
26
|
+
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
27
|
+
*
|
|
28
|
+
* Copyright 2015, 2016 Holger Seelig <holger.seelig@yahoo.de>.
|
|
29
|
+
*
|
|
30
|
+
* This file is part of the X_ITE Project.
|
|
31
|
+
*
|
|
32
|
+
* X_ITE is free software: you can redistribute it and/or modify it under the
|
|
33
|
+
* terms of the GNU General Public License version 3 only, as published by the
|
|
34
|
+
* Free Software Foundation.
|
|
35
|
+
*
|
|
36
|
+
* X_ITE is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
37
|
+
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
|
38
|
+
* A PARTICULAR PURPOSE. See the GNU General Public License version 3 for more
|
|
39
|
+
* details (a copy is included in the LICENSE file that accompanied this code).
|
|
40
|
+
*
|
|
41
|
+
* You should have received a copy of the GNU General Public License version 3
|
|
42
|
+
* along with X_ITE. If not, see <http://www.gnu.org/licenses/gpl.html> for a
|
|
43
|
+
* copy of the GPLv3 License.
|
|
44
|
+
*
|
|
45
|
+
* For Silvio, Joy and Adi.
|
|
46
|
+
*
|
|
47
|
+
******************************************************************************/
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
define ([
|
|
51
|
+
"standard/Math/Numbers/Vector2",
|
|
52
|
+
],
|
|
53
|
+
function (Vector2)
|
|
54
|
+
{
|
|
55
|
+
"use strict";
|
|
56
|
+
|
|
57
|
+
function Line2 (point, direction)
|
|
58
|
+
{
|
|
59
|
+
this .point = point .copy ();
|
|
60
|
+
this .direction = direction .copy ();
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
Line2 .prototype =
|
|
64
|
+
{
|
|
65
|
+
constructor: Line2,
|
|
66
|
+
copy: function ()
|
|
67
|
+
{
|
|
68
|
+
const copy = Object .create (Line2 .prototype);
|
|
69
|
+
copy .point = this .point .copy ();
|
|
70
|
+
copy .direction = this .direction .copy ();
|
|
71
|
+
return copy;
|
|
72
|
+
},
|
|
73
|
+
assign: function (line)
|
|
74
|
+
{
|
|
75
|
+
this .point .assign (line .point);
|
|
76
|
+
this .direction .assign (line .direction);
|
|
77
|
+
return this;
|
|
78
|
+
},
|
|
79
|
+
set: function (point, direction)
|
|
80
|
+
{
|
|
81
|
+
this .point .assign (point);
|
|
82
|
+
this .direction .assign (direction);
|
|
83
|
+
return this;
|
|
84
|
+
},
|
|
85
|
+
setPoints: function (point1, point2)
|
|
86
|
+
{
|
|
87
|
+
this .point .assign (point1);
|
|
88
|
+
this .direction .assign (point2) .subtract (point1) .normalize ();
|
|
89
|
+
return this;
|
|
90
|
+
},
|
|
91
|
+
multMatrixLine: function (matrix)
|
|
92
|
+
{
|
|
93
|
+
matrix .multMatrixVec (this .point);
|
|
94
|
+
matrix .multMatrixDir (this .direction) .normalize ();
|
|
95
|
+
return this;
|
|
96
|
+
},
|
|
97
|
+
multLineMatrix: function (matrix)
|
|
98
|
+
{
|
|
99
|
+
matrix .multVecMatrix (this .point);
|
|
100
|
+
matrix .multDirMatrix (this .direction) .normalize ();
|
|
101
|
+
return this;
|
|
102
|
+
},
|
|
103
|
+
getClosestPointToPoint: function (point, result)
|
|
104
|
+
{
|
|
105
|
+
const
|
|
106
|
+
r = result .assign (point) .subtract (this .point),
|
|
107
|
+
d = r .dot (this .direction);
|
|
108
|
+
|
|
109
|
+
return result .assign (this .direction) .multiply (d) .add (this .point);
|
|
110
|
+
},
|
|
111
|
+
getPerpendicularVectorToPoint: (function ()
|
|
112
|
+
{
|
|
113
|
+
const t = new Vector2 (0, 0);
|
|
114
|
+
|
|
115
|
+
return function (point, result)
|
|
116
|
+
{
|
|
117
|
+
result .assign (this .point) .subtract (point);
|
|
118
|
+
|
|
119
|
+
return result .subtract (t .assign (this .direction) .multiply (result .dot (this .direction)));
|
|
120
|
+
};
|
|
121
|
+
})(),
|
|
122
|
+
intersectsLine: (function ()
|
|
123
|
+
{
|
|
124
|
+
const u = new Vector2 (0, 0);
|
|
125
|
+
|
|
126
|
+
return function (line, point)
|
|
127
|
+
{
|
|
128
|
+
const
|
|
129
|
+
p1 = this .point,
|
|
130
|
+
p2 = line .point,
|
|
131
|
+
d1 = this .direction,
|
|
132
|
+
d2 = line .direction;
|
|
133
|
+
|
|
134
|
+
const theta = d1 .dot (d2); // angle between both lines
|
|
135
|
+
|
|
136
|
+
if (Math .abs (theta) >= 1)
|
|
137
|
+
return false; // lines are parallel
|
|
138
|
+
|
|
139
|
+
u .assign (p2) .subtract (p1);
|
|
140
|
+
|
|
141
|
+
const t = (u .dot (d1) - theta * u .dot (d2)) / (1 - theta * theta);
|
|
142
|
+
|
|
143
|
+
point .assign (d1) .multiply (t) .add (p1);
|
|
144
|
+
|
|
145
|
+
return true;
|
|
146
|
+
};
|
|
147
|
+
})(),
|
|
148
|
+
toString: function ()
|
|
149
|
+
{
|
|
150
|
+
return this .point + ", " + this .direction;
|
|
151
|
+
},
|
|
152
|
+
};
|
|
153
|
+
|
|
154
|
+
Line2 .Points = function (point1, point2)
|
|
155
|
+
{
|
|
156
|
+
const line = Object .create (Line2 .prototype);
|
|
157
|
+
line .point = point1 .copy ();
|
|
158
|
+
line .direction = Vector2 .subtract (point2, point1) .normalize ();
|
|
159
|
+
return line;
|
|
160
|
+
};
|
|
161
|
+
|
|
162
|
+
return Line2;
|
|
163
|
+
});
|