473,387 Members | 1,863 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

A color changing cube

I have an image of a cube, each visible side is broken up into 144 squares. I was wondering if it were possible to write something that would allow someone to click on one of the individual squares and have it change color.

Ultimately I would like for each square to cycle between 3 different colors when clicked. (each color would correspond to something else)

Does anyone have any idea how you would start something like that?

If this is completely unclear let me know so I can try and clear it up.

Thanks for any help,
Oripkcin
Apr 26 '06 #1
2 2575
medusa
2
Taking a simple example (3D cube view, but only 1 square per side) don't you need 3 images (say, top, left and right) in each of the three colours? Absolute position the images and make each a link to a bit of JavaScript to choose the next colour. It should be possible to modify a 'slide show' free script for that. For cycling through the colours either use more complex JavaScript or perhaps cheat & use animated Gifs that cycle once and finish on the colour you want?
Not sure how scaling that up to 144 images per side would work though! (But unless you have a very exotic perspective view you don't need any more image files ... just use them lots of times)
Is this going to finish up as a fiendish new take on Rubic?
Jun 9 '06 #2
hello

i have a similar example fro u
on mouse over i the color would display, use this logic and implement it

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_showHideLayers() { //v6.0
var i,p,v,obj,args=MM_showHideLayers.arguments;
for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
obj.visibility=v; }
}
//-->
</script>
</head>

<body>
<table width="45%" height="43" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="20" bordercolor="#FF0000"><a href="#" onMouseOver="MM_showHideLayers('red','','show');" onMouseOut="MM_showHideLayers('red','','hide');" ><font color="#FF0000">Red</font></a></td>
<td width="20"><a href="#" onMouseOver="MM_showHideLayers('blue','','show')" onMouseOut="MM_showHideLayers('blue','','hide');"> <font color="#0000FF">Blue</font>
</a></td>
<td width="20"><a href="#" onMouseOver="MM_showHideLayers('green','','show')" onMouseOut="MM_showHideLayers('green','','hide');" ><font color="#00FF00">Green</font></a>
</td>
<td width="20"><a href="#" onMouseOver="MM_showHideLayers('yellow','','show') " onMouseOut="MM_showHideLayers('yellow','','hide'); "><font color="#FFFF00">Yellow</font></a></td>
</tr>
<tr>
<td width="20">&nbsp;</td>
<td width="20">&nbsp;</td>
<td width="20">&nbsp;</td>
<td width="20">&nbsp;</td>
</tr>
</table>
<div id="red" style="position:absolute; left:9px; top:33px; width:61px; height:22px; z-index:7; visibility: hidden;" >
<table width="100%" height="100%" border="0"cellpadding="4" cellspacing="0" bgcolor="#FF0000">
<tr>

<td align="center">
</td>
</tr>
</table>
</div>
<div id="blue" style="position:absolute; left:71px; top:33px; width:71px; height:22px; z-index:7; visibility: hidden;" >
<table width="100%" height="100%" border="0"cellpadding="4" cellspacing="0" bgcolor="#0000FF">
<tr>

<td align="center">
</td>
</tr>
</table>
</div>
<div id="green" style="position:absolute; left:145px; top:32px; width:100px; height:22px; z-index:7; visibility: hidden;" >
<table width="100%" height="100%" border="0"cellpadding="4" cellspacing="0" bgcolor="#00FF00">
<tr>

<td align="center">
</td>
</tr>
</table>
</div>
<div id="yellow" style="position:absolute; left:248px; top:33px; width:105px; height:22px; z-index:7; visibility: hidden;" >
<table width="100%" height="100%" border="0"cellpadding="4" cellspacing="0" bgcolor="#FFFF00">
<tr>

<td align="center">
</td>
</tr>
</table>
</div>
</body>
</html>
Aug 25 '06 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: mrwoopey | last post by:
Hi, My OLAP data cube is giving me the following error when I am manipulating OLAP data cube views: "the data being processed is over the allowed limit" I know that this message is caused by...
3
by: Biswajit Barik | last post by:
Hi All, I want to create a cube using MSSQL2000 i dont know any thing how to create and what is parameter required so if any body help me i will be thankfull to him/her.For information : i have 4...
0
by: mrwoopey | last post by:
Hi, I am using the OLAP data cube in a web browser (using the code from the SQL 2000 toolkit). The OLAP services is on database server and the web interface is on the web server. If we do simple...
0
by: Wojtek Jurek | last post by:
I have installed DB2 Cube Views. What should I do to be able to view cube created in Cube Views in MS Office 2003? In OLAP sources for Pivot Table I can see only cubes made in Microsoft tools....
0
by: Fan Ruo Xin | last post by:
I installed Stinger in my PC (w2k). I need to do a quick compare between DB2 OLAP server and DB2 Cube Views. And I only found DB2 Cube Views version8.1 trial code from IBM website. I didn't want to...
0
by: jai83 | last post by:
I have a doubt regarding alphablox-cube views. I have created a cube in the olap centre(using db2 cube view 8.1.10).I imported the cube in alphablox.But while drilling down i am not able to retrieve...
0
by: DC01 | last post by:
I have added a new measure successfully into the normal cube. I then add it to the virtual cube and reprocess all cubes. I can browse the normal cube successfully. Then when I try and browse the...
0
by: Tim | last post by:
Hi Folks, I'm not certain if this is the correct group to post this question in, if there is a more appropriate one please advise. We have a cube that takes a little time to build, length of...
7
by: J-Burns | last post by:
Hello. Need some help here. I have a 4*4 cube. So the equation of the cube becoming: x + 4*y + 16*z Now i want to rotate this cube 90 degrees anticlockwise( a right rotation). How can i do...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.