• To: mathgroup at smc.vnet.net
• Subject: [mg24711] RE: [mg24696] Help Visualization Advice ?
• From: Wolf Hartmut <hwolf at debis.com>
• Date: Wed, 9 Aug 2000 02:31:10 -0400 (EDT)
• Sender: owner-wri-mathgroup at wolfram.com

```
> -----Original Message-----
> From:	Phil [SMTP:zepar at lineone.net]
To: mathgroup at smc.vnet.net
> Sent:	Friday, August 04, 2000 7:19 AM
> To:	mathgroup at smc.vnet.net
> Subject:	[mg24696] Help Visualization Advice ?
>
> Hi,
> I'm considering using mathematica for visualization purposes alongside my
> C++ code. What I wish is to plot (x,y,z) for a grid of points, each point
> will have a value associated with it which will be displayed as a colour.
> Now my worry is that as it is not solely 2D, the 3-D 'cube' will not be
> very
> clear to view. How can I display this 3D plot so that the visualization
> will
> be clear? Or will I have to resort to a few 2D slices at regular z-plane
> intervals to better illustrate my results.
> Thank You.
> Phil.
>
>
[Hartmut Wolf]

Hello Phil,

there are certainly a lot of possibilities to reach 4D visualization (= 3
coordinates + value). Perhaps you might wish to consult Tom Wickham-Jones'
book "Mathematica Graphics: Techniques & Applications"
http://www.amazon.com/exec/obidos/ASIN/0387940472

This here is a simple means to do something:

I assume your data from the C-program are looking something like this:

vv = Flatten[
Table[{((x - 0.5)^2 + (y - 0.5)^2)  , {x, y, z}}, {x, 0., 1., 0.2},
{y,
0., 1., 0.2}, {z, 0., 1., 0.2}], 2];

Short[vv, 2]

Define a function which generates 3D graphics primitives, the value is
encoded to a graphics directive (or any other attribute of the 3D object):

gpMake[{value_, coord_}] := {Hue[1.9 value + 0.1], PointSize[0.033],
Point[coord]}

Show[Graphics3D[gpMake /@ vv]]

So you see the points of the grid with value encoded by color. Instead of
Point you may e.g. use Cuboid:

gpMake2[{value_, coord_}] := {Hue[1.9 value + 0.1],
Cuboid[coord, coord + 0.033]}

Show[Graphics3D[gpMake2 /@ vv], Lighting -> False]

You might wish to find out the best viewpoint(s). Deplorably after...

<< RealTime3D`

...the graphics directives are lost in the modified rendering function, at
least with my version:

{\$Version, \$ReleaseNumber}

{"4.0 for Microsoft Windows (April 21, 1999)", 0}

However you now might encode in size

gpMake3[{value_, coord_}] := {Cuboid[coord, coord + 0.1 value]}

Show[Graphics3D[gpMake3 /@ vv]]

find out the best viewpoint, and then return to the colored graphics (after
having restarted the kernel) Note also, you may encode more than one value
in your graphics, e.g. when you use Arrows (direction and size), balls
(color and size), and also color itself may represent up to 3 values.

Kind regards,
Hartmut Wolf

```

• Prev by Date: Re: Re: Re: More about l`Hopital`s rule
• Next by Date: Re: Package naming