![]() |
X3D Developers Guide |
![]() |
The X3D Developers Guide describes system configuration and setup recommendations that support various software projects supporting the Extensible 3D (X3D) Graphics International Standards.
Ant | Cygwin | DES | DIS | Donate | Example X3D Models | Free | Java | JavaScript | Licensing | MySQL | NetBeans | Projects | Subversion | telnet | Time | Tomcat | Tools | Xj3D | XML | XML Catalog | X3D‑Edit authoring tool | X3D Resources | X3D Scene Authoring Hints | X3D Tooltips | Contact
Ant is a Java library and command-line tool used to automate common tasks for building projects. Ant task syntax is in XML, making task definition and validation much simpler than other build systems.
Ant is used to maintain most web3d.org X3D projects. Key references include:
Recommended ant configuration details follow.
C:\apache-ant-1.10.15
PATH=.;%ANT_HOME%\bin;
... (etc.)
ANT_HOME=C:\apache-ant-1.10.15
ANT_OPTS=-Xss16m -Xmx4096M
or
ANT_OPTS=-Xss16m -Xmx8192M
or
ANT_OPTS=-Xss16m -Xmx12228M
On Windows systems, set environment variables by selecting
Control Panel > System Properties > Advanced settings > Environment variables System variables
C:\apache-ant-1.10.15> ant -f fetch.xml -Ddest=system
ant -version Apache Ant(TM) version 1.10.15 compiled on August 25 2024
junit
,
sshexec
and
scp
require the addition of external
library dependencies.
ANT_HOME
,
then copy
ant-contrib-*.jar
into the
ANT_HOME/lib/
subdirectory.
Also be sure to check ownership and executable permissions for this file.
You can now use any of the
ant-contrib tasks
by including the following top-level statement in your build.xml file.
<taskdef resource="net/sf/antcontrib/antcontrib.properties"/>
xml-resolver.jar
for resolving XML Catalog url alternatives on local file system.
xml-resolver.jar
in the
ANT_HOME/lib/
subdirectory.)
ANT_HOME/lib/
subdirectory.
{user.home}/.ant/lib
directory.
C:\apache-ant-1.10.15
scp
task instead.
Further configuration options are described under Ant Setup.
Utility tools in the Cygwin distribution provide Unix command-line functionality for Windows systems. It is not needed for macOS or Linux systems.
C:\cygwin
ssh
and sftp
commands.
.;C:\cygwin64\bin;
near the beginning (before any Windows default directories)
CYGWIN=nodosfilewarning
/home/Username/
for files .bashrc
.bash_profile
and .inputrc
)
The DES projects are a suite of integrated tools for analytic simulation. This work is entirely built using open-source Java, XML and X3D.
https://eos.nps.edu/svn/Simkit/trunk
with username guest
https://eos.nps.edu/wcm/DISKIT/trunk
with username guest
https://eos.nps.edu/wcm/Viskit/trunk
with username guest
The IEEE Distributed Interactive Simulation (DIS) protocol is an IEEE standard for conducting real-time platform-level simulation across multiple host computers. DIS is one of the most widely used modeling and simulation networking standards. DIS is used worldwide, especially by military organizations but also by other agencies such as those involved in space exploration and medicine.
Overview (from the standard). Data messages, known as Protocol Data Units (PDUs), that are exchanged on a network among simulation applications are defined. These PDUs are for interactions that take place within specified domains called protocol families, which include Entity Information/Interaction, Warfare, Logistics, Simulation Management, Distributed Emission Regeneration, Radio Communications, Entity Management, Minefield, Synthetic Environment, Simulation Management with Reliability, Information Operations, Live Entity Information/Interaction, and Non-Real-Time protocol.
Active Work. NPS is actively implementing complete coverage of the IEEE DIS version 7 protocol.
Key References
The X3D software and models discussed here are openly published without charge and funded by research proposals. You are welcome to donate funds to support these efforts if you wish. The non-profit Web3D Consortium supports this work.
The free cost of open-source software has been fundamentally important to the X3D community's ability to create applications and content that are highly capable, compliant with open standards, highly capable, maintainable and repeatable by others.
This long-term stability is essential to our accomplishing the NPS mission of graduate education and research. It further allows our graduates, and any other government agency, to utilize our standards-driven work compatibly with program life-cycle requirements and industry support.
The development and use of free software avoids common problems of "vendor lock in" through proprietary restrictions, inability of ongoing government efforts to fund the renewal of prior licenses, and inability to pay a company that is otherwise unwilling to perform software bugfixes and corrections.
This approach also avoids the common "short half-life" problems of companies that can either go out of business or else get acquired (and perhaps buried) by other companies. Such business pathologies not only break software but also negate correspondingly significant investments to create content of interest. In turn, such dependency on proprietary software leads to personnel vulnerabilities when an expert programmer or content developer can no longer apply their skills to improve prior accomplishments.
Further information on these software imperatives can be found in the Licensing section and through the following key sources.
Java is the primary programming language used in the web3d.org X3D software projects.
To configure Java on your development system:
jdk-24.0.2
is default Java version for web3d.org X3D projects, used
under a
non-viral open-source license.
docs
directory tree provided by the .zip
into the directory containing the corresponding version of Java.
(Note that OpenJDK Javadoc
uses the same Javadoc as Oracle Javadoc.)
jdk-19.0.1
and the (much earlier but commonplace)
jdk1.8.0_221
.
These are tested under "Development Use" permitted by the
Oracle JDK license.
JAVA_HOME
such as
JAVA_HOME=C:\Program Files\Java\openjdk\jdk-24.0.2
# OpenJDK, or
JAVA_HOME=C:\Program Files\Java\jdk-19.0.1
# Oracle JDK
PATH=.;%JAVA_HOME%\bin;%ANT_HOME%\bin;
PATH
environment variable.
$ java -version # OpenJDK 24 openjdk version "24.0.2" 2025-07-15 OpenJDK Runtime Environment (build 24.0.2+12-54) OpenJDK 64-Bit Server VM (build 24.0.2+12-54, mixed mode, sharing)
$ java -version # Oracle JDK 19 java version "19.0.1" 2022-10-18 Java(TM) SE Runtime Environment (build 19.0.1+10-21) Java HotSpot(TM) 64-Bit Server VM (build 19.0.1+10-21, mixed mode, sharing)
Additional, older Java resources:
C:\Program Files\Java\jdk1.8.0_221\jre\lib\security
JavaScript is a common programming language used in Web browsers for HTML and X3D scripts. n.b. JavaScript is not the same as Java, they are different programming languages.
Wherever possible our group utilizes both open standards and open source licensing.
Motivation: as a government-funded university, it is important that our work be published publicly and made available freely. As researchers working with military students and worldwide communities of interest, we are striving to maximize the interoperability and 3D visualization capabilities of data streams used for situational awareness. Our strategy to accomplish these goals is the development, testing, adoption and evaluation of Web standards.
It is always important to observe Intellectual Property Rights (IPR) requirements. Because of our involvement in multiple groups developing open standards and open source, it is important that our work remains "untainted" and unexposed to software that may contain patent encumbrances. We do not want to jeopardize any of the standards or codebases that we work on.
In particular, we don't like to use tools with the following characteristics:
Rationale for success:
Open Technology Development (OTD) describes accepted best practices for open source and open standards, emphasizing business cases for government agencies, and providing excellent rationales and detailed guidance.
Contributors who wish to provide code or content for any of the archives we maintain can either use the Web3D Consortium open-source license or else another open-source license of their choice. In this way, these public archives remain freely reusable.
NetBeans has excellent support for MySQL databases. The NetBeans help page "Using MySQL with the IDE" is a quick reference. Other resources include:
Additional resources:
A secure shell (ssh) tunnel makes it possible to create a local connection to a remote database on another server.
This makes a port on your local host appear as if it is a port on the remote host. In reality, the traffic is first going into the port on the local host, then going across an encrypted link toRemoteHost.nps.edu
, then being decrypted on the other side, and then sent to the MySQL port onRemoteHost
. Finally the ssh tunnel returns the data response from the database to the port on your local host. This technique is secure because it lets us avoid having to unblock the firewall to open the MySQL port on the remote host. It also ensures that all the passwords and data sent across the network are encrypted. If you are connecting to an NPS database server, you will first need to be connected to the NPS intranet.
ssh -N username@RemoteHost.nps.edu -L 3307:localhost:3306
ssh
Unix command for secure shell. ssh
support under Windows can be found as part of the Cygwin tools.-N
Don't run any commands on the mmowgli host. Optional but nice. username@RemoteHost.nps.edu
your ssh login account on the remote host -L
Set up a tunnel 3307:localhost:3306
Set up a port on your system, 3307, that goes to the MySQL port, 3306, on the remote host.
We use 3307 in this case because there's often a development MySQL server running on
your system that's already using 3306.This technique is also helpful for locally listening to a Tomcat server port. For example:
ssh -N username -L 8080:tomcatServer.nps.edu:8181
lets you monitor remote
tomcatServer
response via your web browser athttp://localhost:8080
Further
ssh
details are available using the Unix help manual page,man ssh
.
Apache NetBeans is the Integrated Development Environment (IDE) used for most web3d.org X3D project development.
Java Javadoc documentation is helpful, be sure to download a local copy of Java Javadoc as part of your current JDK release for faster development and debugging.
docs
directory tree provided by the .zip
into your local directory containing Java.
https://docs.oracle.com/en/java/javase/24/docs/api/index.html
there as well.
Once installed, default NetBeans configuration settings may need modification.
NETBEANS_HOME/etc/netbeans.conf
locations in the NetBeans installation directory tree:
C:\Program Files\NetBeans-26\netbeans\etc\netbeans.conf
(Windows location for default user settings)
netbeans.conf
property:
netbeans_jdkhome="C:\Program Files\Java\openjdk\jdk-24.0.2"
(for example).
netbeans_default_options
environment variables in the
netbeans.conf
property file:
-J-Djdk.xml.entityExpansionLimit=120000;
-J-Djdk.xml.totalEntitySizeLimit=50000000;
-J-Djdk.xml.maxGeneralEntitySizeLimit=50000000;
netbeans_default_options
environment variables in the
netbeans.conf
property file:
-J-Djavax.xml.bind.context.factory=com.sun.xml.bind.v2.ContextFactory;
netbeans_default_options
environment variable:
-J--add-exports=java.xml/com.sun.org.apache.xerces.internal.impl.dv.util=ALL-UNNAMED
Earlier issues and fixes:
netbeans_default_options
environment variable:
-J--illegal-access=warn
netbeans_default_options
environment variable:
-J--add-exports=jdk.internal.opt/jdk.internal.opt=ALL-UNNAMED
which, as reported by
NetBeans issue report,
avoids the compile-time error
Error starting modern compiler
netbeans.conf
file:
-J-Dsun.java2d.dpiaware=true
to
-J-Dsun.java2d.dpiaware=false
netbeans_default_options
environment variable:
-J-Djdk.util.zip.disableZip64ExtraFieldValidation=true
Further configuration settings of interest:
x3d
with Associatiated file type (MIME) selection XML Files (text/xml)
to support X3D scene validation,
sch
with Associatiated file type (MIME) selection XML Files (text/xml)
to support Schematron rule-set validation.
Extensible 3D (X3D) Graphics projects include the following:
The NPS Savage group maintained several open-source projects using X3D.
Subversion is used for version control of many web3d.org X3D projects and files. Support for subversion is built into NetBeans and X3D-Edit.
Tutorial and resource information includes:
Some advanced subversion questions:
svn export [RepositoryURL]
relocate
it using the https: protocol in order to meet security requirements for writing changes.
Use the subversion relocate command:
svn help relocate
The
telnet
protocol is widely used and provides a standard way of interfacing terminal-oriented devices and processes.
Given that security vulnerabilities may exist if used surreptitiously,
modern operating systems typically require specific configuration action to enable it.
ssh
and telnet
.
Also of interest:
ipconfig,
nc (netcat),
netstat,
tracert (traceroute),
whois.
(Of note is that netcat
is also included in Cygwin, but might be quickly scrubbed by NPS antivirus routines for Windows.)
nc (netcat)
which is functionally equivalent to ssh
and can be invoked from inside a terminal process.
Many ad hoc tools also exist (with lesser security) such as
brew.
Numerous simulations and network protocols depend on accurate time adjustment. Most operating systems now include built-in support.
Apache Tomcat is an open-source implementation of the Java Servlet, JavaServer Pages (JSP), Java Expression Language and WebSocket technologies. Tomcat provides a "pure Java" HTTP web server environment in which Java code can run.
Developer installation notes:
CATALINA_HOME
points to root directory of current Tomcat installation, for example
C:\languages\java\apache-tomcat-10.1.20
nb-javac
plugin is installed.
Example information for conf/tomcat-users.xml configuration file follows. Note that any username must also be configured in the Tomcat installation itself.
<role rolename="admin"/> <role rolename="admin-gui"/> <role rolename="admin-script"/> <role rolename="manager-gui"/> <role rolename="manager-script"/> <user username="moi" password="no-really" roles="admin,admin-gui,admin-script,manager-gui,manager-script" />
The Altova XML tools (XMLSpy, Diffdog, etc.) provide outstanding support for XML development.
The following additional tools are also useful.
Xj3D is an open-source browser and application programming interface written in Java for X3D and VRML97 graphics scenes. Many improvements have been made over the years, but more work is needed to support the many features of X3D.
Updated! Xj3D Web3D rerelease in progress July-August 2025. Xj3D is upgraded to latest stable Java 24.0.2 (OpenJDK 24.0.2) using NetBeans 26
Source: https://gitlab.nps.edu/Savage/xj3d and Javadoc (TODO publish Xj3D test reports documentation once updated)
Issues: Xj3D Issue Tracker by NPS
Status: TODO: updated .jars (git) and installers. Regression testing and improvements continue.
Next steps: finish documentation updates and begin adding support for latest version X3D4. Have fun with Xj3D!
Continuing History
Applications using Xj3D include:
Recommended for developers. The most up-to-date Xj3D code repository is now available at:
https://gitlab.nps.edu/Savage/xj3d.git
https://svn.code.sf.net/p/xj3d/code/branches/Supporting_APIs/aviatrix3d
.
A pure retained-mode Java scene graph API over the top of Java OpenGL bindings (JSR 231) and OpenAL Java bindings (for spatialised audio support).
It supports lightweight and heavyweight rendering in AWT, SWT and NEWT environments.
https://svn.code.sf.net/p/xj3d/code/branches/Supporting_APIs/j3d
Prior links for the Xj3D code repository supporting the long-running NPS branch:
Historic links for the original Xj3D trunk supports version 1.0 (released 15 April 2006).
The Extensible Markup Language (XML) is a simple text-based format for representing structured information: documents, data, configuration, books, transactions, invoices, and much more. It was derived from an older standard format called SGML (ISO 8879) in order to be more suitable for World Wide Web usage.
An XML Catalog provides mappings from online URL or generic URI addresses to specific files on the local machine. This allows tools to refer to XML DTDs, schemas etc. to accomplish XML validation without being connected online.
OasisXmlCatalogX3D.xml provides schema and doctype address resolution for typical offline validation of X3D scenes.
Questions, suggestions and comments about these resources are welcome. Please send them to Don Brutzman (don.brutzman at gmail.com)
Available online at https://www.web3d.org/x3d/content/examples/X3dDevelopersGuide.html
Revised 25 July 2025.