Re: Transparency in 3D objects?
- To: mathgroup at yoda.physics.unc.edu
- Subject: Re: Transparency in 3D objects?
- From: twj
- Date: Tue, 20 Oct 92 08:13:27 CDT
>Is there a way to display objects as partially transparent? We >would like to display an object enclosed within a bounding sphere so >that we could see the object through the sphere. We are working on >a Sun with 8-bit color. Since the Mathematica renders graphics into PostScript and in PostScript objects are all totally opaque there is no way to obtain any partial transparency. However it is possible to simulate transparency by placing layers of 3D objects on top of each others out of the normal rendering order. This is done with the Mathematica Rectangle primitive and should work to show an object inside a sphere. This is an example of what can be done. SetOptions[ Graphics3D, PlotRange -> {{-1,2}, {-1,1}, {-1,1}}, Boxed -> False]; sph = First[ ParametricPlot3D[ {Sin[t] Sin[p], Sin[t] Cos[p], Cos[t]}, {t,0,Pi}, {p,0,2Pi}, DisplayFunction -> Identity]]; ob1 = Graphics3D[ {EdgeForm[], sph}] ob2 = Graphics3D[ { GrayLevel[0.3], Thickness[0.005], PointSize[.05],Point[ {0,0,0}], Line[ {{0,0,0}, {1,0,0}}], Thickness[ 0.01], GrayLevel[0], Line[ {{1,0,0}, {2,0,0}}]}] Show[ Graphics[ { Rectangle[ {0,0}, {1,1}, ob1], Rectangle[ {0,0}, {1,1}, ob2] } ]] Tom Wickham-Jones WRI