Future to the fantasy ★ ★
Titania
X3D Editor
Version
1.4

Cobweb 1.25

WebGL X3D Browser

Something special, something more!

Cobweb

A full standard compliant VRML browser!

Donate to your favourite X3D Editor and Browser on PayPal!

Cobweb X3D Browser

Cobweb is a new X3D Browser engine entirely written in JavaScript and uses WebGL for 3D rendering. Authors can publish X3D source within an HTML5 page with Cobweb that works with Web browsers without prior plugin installation. This gives X3D authors the ability to displays content in 3D, using WebGL 3D graphics technology to display X3D content in several different browsers across several different operating systems. Cobweb supports custom shaders, clip planes, reflection mapping, script nodes, prototyping capabilities and event driven programming to provide you with an improved quality level of virtual effects and tools ready for the Internet.

Developer note: Now, Cobweb runs in fresh installs of Firefox, Chromium, Google Chrome and Opera. Cobweb uses functions from the new JavaScript 6 standard, this standard becomes more and more popular and is either now available on your desktop computer or on your modern smart-phone.

Examples

Developer Information

  • Supported browsers: Firefox, Chromium, Google Chrome and Opera Browser.
  • Right click to display the context menu.
  • Click into the X3D browser window to activate keyboard input.
  • Use Page Up and Page Down to navigate between viewpoints if any.
  • Errors are reported in the JavaScript Console of each browser.

X3D Examples Library

All examples are available at GitHub. They are not specially made for Cobweb but most of them are found on the Internet and are provided »as is«. Follow the instruction to download here.

Core Features

Cobweb is freely downloadable for any usage and licensed under the GPL3.

  • Cobweb works seamlessly together with Titania
  • Full VRML2 support, complete and standard compliant
  • High performance JavaScript rendering engine
  • Full VRML Script support
  • Advanced prototyping support
    • unlimited nested prototypes
    • multiple IS references
    • extern prototypes support
  • Advanced shading
    • specification conform Gouraud and Phong shading
    • support for eight simultaneous lights for each Shape node
    • Color node support
    • smooth texture mapping
    • autogenerated normals depending on creaseAngle value
  • Support for complex routing graphs
  • Unbreakable collision detection and terrain following support
  • Support for MovieTexture and Sound node
  • Support for Text and remote font files
  • Prepared for the rich set of standard X3D nodes,
  • and everything you dreamed of.

Embedding Cobweb within a Web Page

To display your X3D scene in a HTML5 page first save your scene as X3D XML Encoded file or as X3D Classic Encoded file, i.e. create a file with the extension .x3d ,.x3dv or .wrl.

The HTML5 page is quite easy to create, the HTML5 code below shows you the minimum requirements. The path to the X3D scene is specified in the url attribute of the X3D tag.

Note: it is important to use a HTML5 page and to save it as .html file.

<!DOCTYPE html>
<html>
   <head>
      <meta charset="utf-8">
      <link rel="stylesheet" type="text/css" href="https://cdn.rawgit.com/create3000/cobweb/master/stable/1/1.25/cobweb.css"/>
      <script type="text/javascript" src="https://cdn.rawgit.com/create3000/cobweb/master/stable/1/1.25/cobweb.min.js"></script>
   <style>
X3D {
   width: 768px;
   height: 432px;
}

   </style>
  
</head>
   <body>
      <X3D url='  "path/to/your/X3D/world.x3d '>
         <p>Your browser may not support all features required by Cobweb!</p>
      </X3D>
   </body>
</html>

To get Cobweb working you must include the CSS file »cobweb.css« and the JavaScript file »cobweb.min.js «. After cobweb is successfully loaded a new HTML tag <X3D> is available on your page.

You can style the X3D tag as every HTML tag with CSS as well as you can place it everywhere within the DOM tree.

Supported File Formats

As of version 1.19, Cobweb can now parse either X3D XML Encoding or X3D Classic Encoding. This gives authors the capability to display their existing projects like .wrl worlds, too.

Additionally files can be compressed using GZip compression.

X3D EncodingFile ExtensionMIME Type
VRML.wrl, .wrzmodel/vrml
Classic VRML.x3dv, .x3dzmodel/x3d+vrml
XML.x3d, .x3dvz

model/x3d+xml

For more information how to configure your web server see here.

Fallback Content

The <X3D> element is equal to the <canvas> element in that, it is easy to define some fallback content, to be displayed in older browsers not supporting it, like currently all other browsers than the recent version of Firefox or older versions of that. You should always provide fallback content to be displayed by those browsers.

Providing fallback content is very straightforward: just insert the alternate content inside the <X3D> element. Browsers that don't support <X3D> will ignore the container and render the fallback content inside it. Browsers that do support <X3D> will ignore the content inside the container, and just render the canvas normally.

For example, we could provide a text description of the X3D element or provide a static image of the dynamically rendered content. This can look something like this:

<X3D url='"world.x3d"'>
   <p>Current stock price: $3.15 +0.15</p>
</X3D>

<X3D url='"world.x3dv"'>
   <img src="images/clock.png"/>
</X3D>

Attributes of the X3D Tag

The HTML <X3D> tag defines the main content of the X3D document. The X3D tag has two attributes that define different behaviours. All of these attributes are optional.

url

A MFString value with urls that should be loaded on page load. If no url is specified or the url field is empty an empty scene is displayed.

cache

A Boolean value (true or false) to indicate whether files transferred over the internet should be cached on the local computer. The default value for the cache attribute is true. It works by appending "_={timestamp}" to the GET parameters of every request.

Example

<X3D cache='true' url='
   "
path/to/your/X3D/world.x3d",
   "path/to/your/X3D/at/another/location/of/world.x3dv"
   "https://example.com/world.wrl"
'></X3D>

Note: Carefully place the quotes around the URL's.

Keyboard Shortcuts

Before you can use the keyboard you must click into the X3D browser window to activate keyboard input.

  • Use Page Up and Page Down to navigate between viewpoints.
  • Use Ctrl + + to display some browser timings.
  • You can toggle the shading by pressing Ctrl + [1-5]
    1. Pointset
    2. Wireframe
    3. Flat shading
    4. Gouraud shading (default)
    5. Phong shading
  • Use Ctrl + s to toggle browser live mode.

Custom Shaders

When you display your 3D models with Cobweb by default it will use our Gouraud shader. This is a versatile shader that can cover a lot of your rendering needs. If this is not enough there is also a Phong shader available, adjustable with the browser shading option per scripting.

However, you will often want to perform special effects or special cases for your materials. To do this you will need to write a custom shader.

Learn more about custom shaders.

Using Google Chrome and Opera with local files

Cobweb makes use of the XMLHttpRequest object to load files and there's no way round that. But that means files loading using the file:// scheme protocol are subject to the same origin policy and are handled as cross origin requests (CORS) and cross origin requests are only supported for protocol schemes: http, data and https. That means Cobweb cannot have access to this files.

To work around this problem you must set up a localhost server, than you can access your local files under the web address http://localhost/... This can be done using XAMPP from the https://www.apachefriends.org website. XAMPP is a completely free, easy to install Apache distribution containing MariaDB, PHP, and Perl. The XAMPP open source package has been set up to be incredibly easy to install and to use.

Supported Components

All nodes listed below are intended to be completely implemented.

CAD

  • CADAssembly
  • CADFace
  • CADLayer
  • CADPart
  • IndexedQuadSet
  • QuadSet

Core

  • PROFILE
  • COMPONENT
  • UNIT
  • META
  • EXTERNPROTO
  • PROTO
  • IS
  • DEF
  • USE
  • IMPORT
  • ROUTE
  • EXPORT
  • MetadataBoolean
  • MetadataDouble
  • MetadataFloat
  • MetadataInteger
  • MetadataSet
  • MetadataString
  • WorldInfo

CubeMapTexturing*

  • ComposedCubeMapTexture

EnvironmentalEffects*

  • Background
  • Fog
  • LocalFog
  • TextureBackground

EnvironmentalSensor

  • ProximitySensor
  • TransformSensor
  • VisibilitySensor

EventUtilities

  • BooleanFilter
  • BooleanSequencer
  • BooleanToggle
  • BooleanTrigger
  • IntegerSequencer
  • IntergerTrigger
  • TimeTrigger

Followers

  • ColorChaser
  • ColorDamper
  • CoordinateChaser
  • CoordinateDamper
  • OrientationChaser
  • OrientationDamper
  • PositionChaser
  • PositionDamper
  • PositionChaser2D
  • PositionDamper2D
  • ScalarChaser
  • ScalarDamper
  • TexCoordChaser2D
  • TexCoordDamper2D

Geometry2D

  • Arc2D
  • ArcClose2D
  • Circle2D
  • Disk2D
  • Polyline2D
  • Rectangle2D
  • TriangleSet2D

Geometry3D

  • Box
  • Cone
  • Cylinder
  • ElevationGrid
  • Extrusion
  • IndexedFaceSet
  • Sphere

Geospatial

  • GeoCoordinate
  • GeoElevationGrid
  • GeoLocation
  • GeoLOD
  • GeoMetadata
  • GeoOrigin
  • GeoPositionInterpolator
  • GeoProximitySensor
  • GeoTouchSensor
  • GeoTransform
  • GeoViewpoint

Grouping

  • Group
  • StaticGroup
  • Switch
  • Transform

Interpolation

  • ColorInterpolator
  • CoodinateInterpolator
  • CoordinateInterpolator2D
  • EaseInEaseOut
  • NormalInterpolator
  • OrientationInterpolator
  • PositionInterpolator
  • PositionInterpolator2D
  • ScalarInterpolator
  • SplinePositionInterpolator
  • SplinePositionInterpolator2D
  • SplineScalarInterpolator
  • SquadOrientationInterpolator

Layering

  • Layer
  • LayerSet
  • Viewport

Layout

  • Layout
  • LayoutGroup
  • LayoutLayer
  • ScreenFontStyle
  • ScreenGroup

KeyDeviceSensor

  • KeySensor

Lighting

  • DirectionalLight
  • PointLight
  • SpotLight

Navigation

  • Billboard
  • Collision
  • LOD
  • NavigationInfo
  • OrthoViewpoint
  • Viewpoint
  • ViewpointGroup

Networking

  • Anchor
  • Inline
  • LoadSensor

NURBS

  • CoordinateDouble

ParticleSystems

  • BoundedPhysicsModel experimental

  • ConeEmitter
  • ExplosionEmitter
  • ForcePhysicsModel
  • ParticleSystem
  • PointEmitter
  • PolylineEmitter
  • SurfaceEmitter
  • VolumeEmitter
  • WindPhysicsModel

PointingDeviceSensor

  • CylinderSensor
  • PlaneSensor
  • SphereSensor
  • TouchSensor

Rendering

  • ClipPlane
  • Color
  • ColorRGBA
  • Coordinate
  • IndexedLineSet
  • IndexedTriangleFanSet
  • IndexedTriangleSet
  • IndexedTriangleStripSet
  • Normal
  • PointSet
  • TriangleFanSet
  • TriangleSet
  • TriangleStripSet

Scripting

  • Script

Shaders*

  • ComposedShader
  • ShaderPart

Shape*

  • Appearance
  • Material
  • Shape
  • TwoSidedMaterial

Sound

  • AudioClip
  • Sound

Text

  • FontStyle
  • Text

Texturing*

  • ImageTexture
  • MovieTexture
  • PixelTexture
  • TextureCoordinate
  • TextureProperties
  • TextureTransform

Texturing3D*

  • TextureCoordinate3D
  • TextureCoordinate4D
  • TextureTransform3D
  • TextureTransformMatrix3D

Time

  • TimeSensor

* Partial implemented, i.e. not all nodes of this component are available.
* New nodes.
* Comming soon

X3D International Standards

Cobweb is based on the the X3D International Standard and this standard is available online on web3d.org on the pages listed below. You can read there all about node types and JavaScript functions and properties available.

X3D Specifications

Language bindings

VRML Reference

Cobweb is based on the X3D International Standard where VRML is a subset of X3D. Cobweb supports the full VRML standard that is available online at:

Report a Bug

If you run into any bugs or encounter any other abnormal issues with Cobweb, let us know!

Here's an example of a helpful bug report:

I fell through a hole on the Resistance map. I was running along the wall near the pool of water and fell through a black hole in the wall. I got stuck and had to leave the match. This happened while playing Search and Destroy.

Cobweb Feedback Survey and Bug Report