X3D Intro
This file is available via
the course webpage at:
http://www.macs.hw.ac.uk/~ruth/year4VEs/Labs/X3DIntro-resources.htm
X3D
There is only one X3D book
as yet, by Don Brutzman, see http://www.x3dbook.com/ where the associated slide material can also
be found.
Or go to http://x3dgraphics.com/slidesets/ to get the slides as either .pdf or .odp.
The examples used in the
book can be browsed at:
http://www.x3dbook.com/examples/X3dForWebAuthors/index.html
The earlier definitive
guide to VRML was:
'The
VRML Sourcebook', edition 2, Ames, Nadeau & Moreland, Wiley
and is still useful, even though it uses the VRML
rather than the X3D encoding. However the examples can also be found in the
XML-based X3D encoding at http://www.web3d.org/x3d/content/examples/Vrml2.0Sourcebook/ and we will be using these during
the lab work.
The Web3D Consortium is a
key starting point for everything on the web in 3D:
http://www.web3d.org/ and the X3D resources can be found at http://www.web3d.org/x3d/
We will be using either the
X3dEdit editor, or the Submarine X3d editor, both installed in the lab and freely
available at https://savage.nps.edu/X3D-Edit/ and www.submarine.unipg.it/
Viewers and browser
plug-ins
For X3D content, we are
using the Octaga Player – see www.octaga.com/ - which can be used in a free version. We have installed it in the labs
and it works either stand-alone or as a plugin with IE and possibly Firefox.
The Cortona plugin is
still around and still works for VRML encoded content. It has been upgraded
recently though there are probably still VRML nodes it doesnŐt handle. Get it
from http://www.cortona3d.com/Products/Viewer/Cortona-3D-Viewer.aspx.
NIST have a really useful
plugin detector page at http://cic.nist.gov/vrml/vbdetect.html which tells
you what there is for your set up and where to get it when you visit it.
X3D/VRML
This is basically just a
file format which allows a 3D scene to be loaded and
interacted with via a web browser. X3D is a more modern superset of VRML which uses XML syntax instead of the VRML parantheses.
So you can enter X3D
descriptions via any text editor you happen to like using – for example
you can use Notepad on PCs. However MUCH better to use an editor which
supports the syntax such as X3dEdit
or Submarine.
You can learn a lot by
looking at existing X3D files – there are a large number of examples on
the Web3D archive, and you are recommended to look carefully at these to see
how effects are achieved.
Note that I may well set
exam questions drawing on the detailed knowledge of X3D you should have
acquired by carrying out the work below. Past papers assumed the use of VRML
but as X3D includes VRML, the same sort of questions may well come up but
assuming X3D syntax.
The output of these three
labs is to be handed in by start of week 6 – Monday Feb 11th. You should do this be sending me an email,
to arrive by 5pm, in which you give me the URL of the models you have created
so I can take a look at them. These should be located in your personal
webspace and you should check well ahead if you are not sure where this is and
how to use it.
You will also be asked to
demo a sports stadium building you have modelled along with the rest of your
assignment later in the term.
Lab 1
First make sure that you can bring up one of the X3d
editors and an X3d player.
Using the run box and invoking x3d-edit
should bring the editor up. Note the use of lower-case. Ignore the warnings.
Loading the HelloWorld.x3d file to be found via the
Models link on the course webpage into IE should load the Octaga player.
An introductory X3D tutorial can be found at: http://www.niallmoody.com/heilan/basictutorial.htm
Exercise 1
Check you understand the
introductory tutorial by producing in turn a Box,
a Cone, a Cylinder
and a Sphere. Vary the dimensions and the colour and
materials.
Now check out the Flattened
Cone, the Hollow Cylinder, and the Plus sign at http://www.web3d.org/x3d/content/examples/Vrml2.0Sourcebook/Chapter03-Shapes/index.html
Exercise 2
The next thing is to
combine primitive shapes into more complex assemblies using group and transform
nodes and naming assembles so they can be referenced more than once.
Try building a tower of
cubes; now try a cylinder with a cone on top
You need to look at the Transform node and translation, rotation and scaling.
Look at the models at http://www.web3d.org/x3d/content/examples/Vrml2.0Sourcebook/Chapter05-PositioningShapes/index.html with first the simple translation of a
cylinder, and the archway. Note the use of DEF and USE in this file to name
parts of the structure and reuse them.
Exercise 3
Now look at the file castle.wrl via the Models link on the webpage.
Design a building or your
own – either a shopping centre or your favourite type of religious building -
start building it. Note I expect you to produce something that does not
look just the same as this one!
Lab 2
Exercise 4
Read the slides introducing
extrusion at http://www.macs.hw.ac.uk/modules/F24VS2/Labs/extr3.htm
Look at the models at:
http://www.web3d.org/x3d/content/examples/Vrml2.0Sourcebook/Chapter15-Extrusion/index.html using extrusion.
Produce some simple
extruded shapes. Now add some extrusions to your building.
Exercise 5
Now read the slides about
elevation grids at http://www.macs.hw.ac.uk/modules/F24VS2/Labs/elev1.htm
Look at the examples at http://www.web3d.org/x3d/content/examples/Vrml2.0Sourcebook/Chapter14-ElevationGrid/index.html and see if you can site your building on top
of a mountain.
Exercise 6
Read the slides on routes
and animation at http://www.macs.hw.ac.uk/modules/F24VS2/Labs/dyn1.htm
Look at the examples at http://www.web3d.org/x3d/content/examples/Vrml2.0Sourcebook/Chapter08-AnimatingPositionOrientationScale/index.html
Start trying to animate something in
your building. Note that if you want a door to open, it needs to rotate about
one edge, not about its middle.
Lab3
Exercise 7
Read the slides on controlling
timers at
http://www.macs.hw.ac.uk/modules/F24VS2/Labs/time1.htm
Use the information about timers
with the animations you started in Exercise 6. Can you make an animation that
runs once and then stops/ that rins for ever? How
about animating colour rather than position?
Exercise 8
Read the slides on user interaction
at
http://www.macs.hw.ac.uk/modules/F24VS2/Labs/action.htm
Have a look at the examples on user
interaction at:
http://www.web3d.org/x3d/content/examples/Vrml2.0Sourcebook/Chapter09-SensingViewer/index.html
Add the ability to interact with
your model in at least two different ways.
Lab4
Exercise 9
Read the slides about Fog at:
http://www.macs.hw.ac.uk/modules/F24VS2/Labs/fog1.htm
See http://www.web3d.org/x3d/content/examples/Vrml2.0Sourcebook/Chapter23-Fog/index.html
for some examples.
Read about Lights
at:
http://www.macs.hw.ac.uk/modules/F24VS2/Labs/light1.htm
See http://www.web3d.org/x3d/content/examples/Vrml2.0Sourcebook/Chapter20-Lighting/index.html
for some examples
Now add some fog and lights to your
model.
Exercise
10
Read the slides about texture at http://www.macs.hw.ac.uk/modules/F24VS2/Labs/map.htm
Now add textures to your model. You
can find many free ones on the web.
X3D examples can be seen at http://www.web3d.org/x3d/content/examples/Vrml2.0Sourcebook/Chapter18-TextureMapping/index.html
and the full scope of what is available can be seen at http://www.web3d.org/files/specifications/19775-1/V3.2/Part01/components/texturing.html .
Texture is often used to produce a
sky-dome; for grass; and for materials on buildings. Note that this frequently
involves tiling a texture in small patches across a bigger piece of geometry.
Tiles of 1024 by 1024 pixels are the most portable between different modelling
formats so you might want to think about that since you probably want your
textures from your 3d model to move to your OpenSG model.