You can step through the slides with → and ↓
Hit the ESC for an overview of the slideset (be patient wait for assets to load)Markup is information that is embedded in the text of a document that is not intended for printing or display. It may consist of instructions to a printing device, commands for a Web browser, or comments to a coauthor. The form the markup takes is a function of the particular markup language used.
radius='0.0125' onclick="$('#dialog').dialog('open'); $('#dialog').html('<p> You just selected the '+ $(this).parent().parent().attr('description') + ' landmark. </p>'); $('#dialog') .dialog( {title: $(this) .parent() .parent() .attr('description') });
for each element of the type (shape)
do something fn()
<transform id='lm0' description='Sellion'> <shape> <appearance> <material id='mat0' diffuseColor='0 0.9 0'></material> </appearance> <sphere id='asphere' radius='0.0125' ... </sphere> </shape> </transform>
$('#asphere').parent().parent().attr('description');
<TimeSensor id='TIMER' cycleInterval='15' loop='true'></TimeSensor>
<OrientationInterpolator DEF='OI' key='0 0.5 1' keyValue='1 0 0 0, 1 0 0.5 3.14, 1 0 1.0 6.28'></OrientationInterpolator>
<ROUTE fromNode='TIMER' fromField='fraction_changed' toNode='OI' toField='set_fraction'></ROUTE>
<ROUTE fromNode='OI' fromField='value_changed' toNode='coneTrafo' toField='rotation'></ROUTE>
<X3D xmlns="http://www.web3d.org/specifications/x3d-namespace" width="400px" height="400px">
<Scene>
<navigationInfo type='"EXAMINE" "WALK" '></navigationInfo>
<Transform DEF="coneTrafo" class="coneClass" translation="-4.5 0 0">
<Shape DEF="coneShape">
<Appearance>
<Material diffuseColor="0 1 0" specularColor=".5 .5 .5" ></Material>
</Appearance>
<Cone DEF="cone" ></Cone>
</Shape>
</Transform>
<Viewpoint centerOfRotation="0 0 0" position="0 0 15" orientation="0 1 0 0" ></Viewpoint>
<TimeSensor id='TIMER' cycleInterval='15' loop='true'></TimeSensor>
<OrientationInterpolator DEF='OI' key='0 0.5 1' keyValue='1 0 0 0, 1 0 0.5 3.14, 1 0 1.0 6.28'></OrientationInterpolator>
<ROUTE fromNode='TIMER' fromField='fraction_changed' toNode='OI' toField='set_fraction'></ROUTE>
<ROUTE fromNode='OI' fromField='value_changed' toNode='coneTrafo' toField='rotation'></ROUTE>
</Scene>
</X3D>
<x3d xmlns="http://www.x3dom.org/x3dom">
<scene>
<viewpoint position='0 0 10' ></viewpoint>
<transform id="exTrans">
<shape>
<appearance>
<material id="mat" diffuseColor='0.603 0.894 0.909' ></material>
</appearance>
<box id='box' ></box>
</shape>
</transform>
</scene>
</x3d>
<sphere radius="0.0125"
onclick="$("#dialog").dialog("open");
$(".timer").attr("cycleInterval","0");
$("#clock1").attr("cycleInterval","2.0");
$("#dialog").html("<p> You just selected the "+ $(this).parent().parent().attr("description") + " landmark. </p>");
$("#dialog").dialog( {title: $(this).parent().parent().attr("description") });"
</sphere>
function cloneLandmarks(idstr, matstr) {
for (var index = 0; index < OrigLandmarks[0].length; index++) {
$(".ball").each(function(index) {
newNum = new Number(index + 1);
newElem = $("#"+idstr+"0").clone().attr("id", "idstr" + newNum);
newElem.attr("description",
OrigLandmarks[0][index].description);
newElem.attr("translation",
OrigLandmarks[0][index].translation);
//2nd child of shape is sphere
//replace clock1 with correct clock id
tmpObj = newElem.children().children(":nth-child(2)");
tmpClickStr = tmpObj.attr("onclick");
ntmpClickStr = tmpClickStr.replace(/clock1/i,"clock"+newNum);
newElem.children().children(":nth-child(2)").attr("onclick",ntmpClickStr);
newElem.children() //replace mat1 with mat id
.children().children()
.attr("id",matstr+newNum);
$("#"+idstr+"0").after(newElem); // place the new transform
}
};
cloneLandmarks('lm','mat');
newElem = $('#lm0').clone().attr('id', 'lm' + newNum);
tmpObj = newElem.children().children(':nth-child(2)');
tmpClickStr = tmpObj.attr('onclick');
ntmpClickStr = tmpClickStr.replace(/clock1/i,"clock"+newNum);
<X3D xmlns="http://www.web3d.org/specifications/x3d-namespace" id="spheres" showStat="true" x="0px" y="0px" width="400px" height="400px" style="float:left;">
<Scene DEF='scene'>
<Viewpoint position='0 0 10' />
<Background skyColor='1 1 1' />
<Transform id='trans'>
<Shape>
<Appearance>
<Material diffuseColor='0 0 0' specularColor='.2 .2 .2' />
</Appearance>
<Box DEF='box'/>
</Shape>
</Transform>
</Scene>
</X3D>
<div id="ctrlContainer">
<p>Change the color of the cube using the RGB sliders, which updates the "diffuseColor" attribute of the Material node using jQuery.</p>
<div id="sliderContainer">
<ul>
<li><label>Red</label><div id="redSlider" class="slider"/></li>
<li><label>Green</label><div id="greenSlider" class="slider"/></li>
<li><label>Blue</label><div id="blueSlider" class="slider"/></li>
</ul>
</div>
</div>
$(document).ready(function(){
// Create the sliders
$(".slider").slider({min: 0, max: 1, step: 0.01, slide: function(e, ui) {
var newCol = $("#redSlider").slider('option', 'value') + " "
+ $("#greenSlider").slider('option', 'value') + " "
+ $("#blueSlider").slider('option', 'value');
$("Material").attr("diffuseColor", newCol);
}});
});
function cloneViewpointButtons() {
$('#nameClone').show(); // show the button to clone
var Viewpoints = $("viewpoint"); //select all viewpoint elements and place into array
// original source of clone button code
// http://charlie.griefer.com/blog/index.cfm/2009/9/17/jQuery--Dynamically-Adding-Form-Elements
//iterate through all of the viewpoints
$("viewpoint").each( function(index) {
newNum = new Number(index + 1);
newElem = $('#nameClone').clone().attr('id', 'name' + newNum); //clones only the button
newElem.attr('class', 'viewbutts'); // assign a classname to allow deletion of all but first button
newElem.attr('value', $(this).attr('description'));
//use the animate visual effect and
//create an anonymous function to execute when button is clicked
newElem.button().click(function() {
$(this).animate({opacity: 0.5}, 1500);
$(Viewpoints[index]).attr('set_bind','true'); // this must be an actual viewpoint
var descrip = $(Viewpoints[index]).attr('description');
var htmlStr = "Current Viewpoint: " + descrip + "";
$('#currViewpoint').html(htmlStr);
});;
$('#nameClone').before(newElem); // place the new button after the old div
});
$('#nameClone').hide(); // hide the button to clone
};
Couldn't change the viewpoint element because it's an ELEMENT and we need it.
But we can add a new class "flipvp" to name only those viewpoint elements that we want to play with for this page
(function($) {
$.fn.X3DOMgeomButton = function(options) {
// Extend our default options with those provided.
// Note that the first arg to extend is an empty object -
// this is to keep from overriding our "defaults" object.
var opts =
$.extend({}, $.fn.X3DOMgeomButton.defaults, options);
// iterate each matched element
return this.each(function() {
var base = $(this);
//var attribute = base.attr(opts);
var scaleOpt = opts.scale;
var onclickOpt = opts.onclick;
var diffuseColorOpt = opts.diffuseColor;
var translationOpt = opts.translation;
if (scaleOpt) base.attr('scale',scaleOpt);
if (onclickOpt) base.attr('onclick',onclickOpt);
if (translationOpt) base.attr('translation',translationOpt);
// base is the transform then -> shape -> appearance -> material
if (diffuseColorOpt) base.children().children().children().attr('diffuseColor',diffuseColorOpt);
});
};
$.fn.X3DOMgeomButton.defaults = {
scale: '10 10 10',
onclick: 'alert("I am hit");',
diffuseColor: '0 1 0'
// do not want a default translation because
//generally objects exist where they should
};
})(jQuery);
$('#tr0').X3DOMgeomButton(
{ onclick : 'alert("You hit id0 object")',
diffuseColor: '0.5, 1, 1',
translation: '5 0 0'});
$('#tr1').X3DOMgeomButton({ onclick : 'alert("You hit id1 object")',
diffuseColor: '0.8 0 0',
scale: '10 1 10'});
$('#tr2').X3DOMgeomButton({ onclick : 'alert("You hit id2 object")',
diffuseColor: '0.8 0 0.8',
scale: '5 1 5'});