Sandy Ressler
National Institute of Standards and Technology
Web3D 2013, San Sebastian Spain, June 20-22, 2013
- puts geometry in the DOM
- this is GREAT ... up to a point (but not a million points)
$('#sphScaleUp').click(function() {
$('sphere.sphA').parent().parent().attr('scale','10 10 10');
});
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');
AnthroGloss - Anthropometric Landmark Glossary from sandyr on Vimeo.
CAESAR 4391 from sandyr on Vimeo.
<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');
Dancing CAESAR Poser from sandyr on Vimeo.