Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #10049

Re: How to combine 3D Graphics?

From "djmpark" <djmpark@comcast.net>
Newsgroups comp.soft-sys.math.mathematica
Subject Re: How to combine 3D Graphics?
Date 2012-05-12 08:59 +0000
Organization Steven M. Christensen and Associates, Inc and MathTensor, Inc.
Message-ID <jol8pe$4a2$1@smc.vnet.net> (permalink)
References <18312799.4531.1336710717412.JavaMail.root@m06>

Show all headers | View raw


This is easy using the RaiseTo3D function in the Presentations Application.

Here is the transparent surface with a density plot at the z = -1 plane. I
used a more distinctive coloring function for the density plot.

<< Presentations` 

Draw3DItems[
 {(* Draw the transparent surface *)
  {Opacity[0.5, Orange],
   Draw3D[Sin[x + y], {x, 0, Pi}, {y, 0, Pi}, Mesh -> False]},
  
  (* Draw the density plot and raise it to 3D *)
  DensityDraw[Sin[x + y], {x, 0, Pi}, {y, 0, Pi},
    PlotPoints -> 40,
    ColorFunction -> ColorData["DarkRainbow"]] // RaiseTo3D[-1 &]},
 NeutralLighting[0, 0.2, 0.5],
 NiceRotation,
 Axes -> True,
 ImageSize -> 300] 

In the following we put a transparent contour plot on the surface and a
density plot at z = -1.

Draw3DItems[
 {(* Draw a contour plot and raise it to the surface *)
  {Opacity[0.8],
   ContourDraw[Sin[x + y], {x, 0, Pi}, {y, 0, Pi},
     PlotPoints -> 40,
     ColorFunction -> ColorData["DarkRainbow"]] // 
    RaiseTo3D[Sin[#1 + #2] &]},
  
  (* Draw a density plot and raise it to the z = -1 surface *)
  DensityDraw[Sin[x + y], {x, 0, Pi}, {y, 0, Pi},
    PlotPoints -> 40,
    ColorFunction -> ColorData["DarkRainbow"]] // RaiseTo3D[-1 &]},
 NeutralLighting[0, 0.2, 0.5],
 NiceRotation,
 Axes -> True,
 ImageSize -> 300]

Just draw one thing after another.


David Park
djmpark@comcast.net 
http://home.comcast.net/~djmpark/index.html 


From: Jee Lou [mailto:ywdr1987@gmail.com] 


I have tried to combine a translucent 3D-plot graph with its density plot by
using Show. But it doesn't work. Here's my code:
g1=Plot3D[Sin[x + y], {x, 0, Pi}, {y, 0, Pi}, Mesh ->
False,PlotStyle->Opacity[.5]]; g2=DensityPlot[Sin[x + y], {x, 0, Pi}, {y, 0,
Pi}, Frame -> False]; g3=Plot3D[-1, {x, 0, Pi}, {y, 0, Pi}, Mesh ->
None,TextureCoordinateFunction -> ({#1, #2} &), PlotStyle ->
Directive[Texture[g2]]]; Show[g1,g3] It turns out that the density graph
disappears T_T.
How can I make it right? 

Back to comp.soft-sys.math.mathematica | Previous | Next | Find similar | Unroll thread


Thread

Re: How to combine 3D Graphics? "djmpark" <djmpark@comcast.net> - 2012-05-12 08:59 +0000

csiph-web