[x3d-public] Cubes interconnected model
Konstantin Smirnov
konstantin.e.smirnov at gmail.com
Tue Feb 1 23:59:22 PST 2022
Hello
How to make this interconnected?
I need cubes to be in three planes, connected
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge" charset="UTF-8"/>
<title>My first X3DOM page</title>
<script type='text/javascript' src='
https://www.x3dom.org/download/x3dom.js'> </script>
<link rel='stylesheet' type='text/css' href='
https://www.x3dom.org/download/x3dom.css'>
<script>
function changeColor()
{
if(document.getElementById("color").getAttribute('diffuseColor')=="1 0 0")
document.getElementById("color").setAttribute('diffuseColor', '0 0 1');
else
document.getElementById("color").setAttribute('diffuseColor', '1 0 0');
}
function dataload()
{
$('#digital_download2').load('http://localhost/index2.php', function(data){
alert(data)});
}
</script>
<style>
x3d
{
border:2px solid darkorange;
background: rgba(128, 128, 128, 0.4);
}
body
{
font-size:110%;
font-family:verdana, sans-serif;
background-image: url('pattern.png');
margin: 3em;
color: lightgray;
}
h1
{
color: darkorange;
}
</style>
</head>
<body>
<h1>Hello, X3DOM!</h1>
<p>
</p>
<x3d width='500px' height='400px'>
<scene>
<shape onclick="changeColor(); dataload();">
<appearance>
<material id ="color" diffuseColor='1 0 0'></material>
</appearance>
<box></box>
</shape>
<transform translation='-3 0 0'>
<shape>
<appearance>
<material diffuseColor='0 1 0'></material>
</appearance>
<box></box>
</shape>
</transform>
<transform translation='3 0 0'>
<shape>
<appearance>
<material id="color3" diffuseColor='0 0 1' size="2 2
2"></material>
</appearance>
<box></box>
</shape>
</transform>
</scene>
</x3d>
<div id="digital_download">
A
</div>
<div id="digital_download2" style="display: none;">
</script>
</body>
</html>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20220202/38e2bbc6/attachment.html>
More information about the x3d-public
mailing list