Re: ContourPlot3D and mapping
- To: mathgroup at smc.vnet.net
- Subject: [mg55102] Re: ContourPlot3D and mapping
- From: <homh at momentum.chem.queensu.ca>
- Date: Sat, 12 Mar 2005 02:36:51 -0500 (EST)
- Organization: Queen's University, Kingston
- References: <d0p8ch$j8c$1@smc.vnet.net> <d0rp54$2hh$1@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
Jon Harrop <usenet at jdh30.plus.com> wrote: > homh at momentum.chem.queensu.ca wrote: >> I have a surface that is described by a function f[x,y,x] = C. I need to >> map the values of another function g[x,y,z] on this surface, probably by >> some kind of color scheme. It is something like giving "texture" to >> an isovalue surface. > Consider the 3D contour plot generated by: > graph = ContourPlot3D[x^2 + y^2 + z^2 - 1, {x, -2, 2}, {y, -2, 2}, {z, -2, > 2}, PlotPoints -> 6]; > The following function replaces all polygons in "g" with colored polygons > using a color "f": > ReColor[f_, g_] := > g[[1]] /. > Polygon[p_] :> Block[{r = Mean[p]}, {f[r], Polygon[p]}] > This example coloring function "f" can be applied to our example contour > plot: > f[{x_, y_, z_}] := RGBColor[(x + 1)/2, (y + 1)/2, (z + 1)/2] > The result can be rendered using: > Show[Graphics3D[ReColor[f, graph]], Lighting -> False] > -- > Dr Jon D Harrop, Flying Frog Consultancy > http://www.ffconsultancy.com Hi, I tried the above code with the following added Needs["Graphics`ContourPlot3D`"]; << Graphics`Graphics3D`; and got the error message: Graphics3D::"gprim": f[Mean[{{-0.7250000000000001`, -\[LeftSkeleton] 19 \[RightSkeleton], -0.3999999999999999`, \[LeftSkeleton] 2 \[RightSkeleton]} was encountered where a Graphics3D primitive or directive was expected." Any idea ? Minhhuy