Mathematica 9 is now available
Student Support Forum
-----
Student Support Forum: 'An Array of Cuboids' topicStudent Support Forum > General > "An Array of Cuboids"

< Previous Comment | Next Comment >Help | Reply To Comment | Reply To Topic
Author Comment/Response
Bill Simpson
12/05/12 1:25pm

You have RGBColor[{i,j,k}] and you need RGBColor[i,j,k] so use RGBColor@@p

You also need to make certain that 0<=i,j,k<=1 so you may need to divide by something other than 6 or do something else to ensure this.

This works.

Show[Graphics3D[Table[With[{p = {i,j,k}/6}, {RGBColor@@p, Opacity[.75], Cuboid[p, p+.15]}], {i,5}, {j,5}, {k,5}]]]

Now you just need to use your Table to construct the cubes of size and position that you want.

URL: ,

Subject (listing for 'An Array of Cuboids')
Author Date Posted
An Array of Cuboids Strelok 12/05/12 09:45am
Re: An Array of Cuboids Bill Simpson 12/05/12 1:25pm
Re: Re: An Array of Cuboids Strelok 12/06/12 05:22am
Re: Re: Re: An Array of Cuboids Bill Simpson 12/09/12 00:30am
Re: Re: Re: An Array of Cuboids Michael 12/09/12 08:43am
< Previous Comment | Next Comment >Help | Reply To Comment | Reply To Topic