Mathematica 9 is now available
Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2005
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2005

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Desperate help

  • To: mathgroup at smc.vnet.net
  • Subject: [mg61483] Re: [mg61438] Desperate help
  • From: "David Park" <djmp at earthlink.net>
  • Date: Wed, 19 Oct 2005 23:07:37 -0400 (EDT)
  • Sender: owner-wri-mathgroup at wolfram.com

With the DrawGraphics package from my web site below it's pretty easy. Here
are two methods. One uses DrawingTransform3D to apply transformations to the
3D graphics primitives. The other uses the TranslateShape routine from the
Shapes packaged, but adapted to work directly on primitive graphics.

Needs["DrawGraphics`DrawingMaster`"]

Draw3DItems[
    {SphericalDraw3D[2, {theta, 0, Pi}, {phi, 0, 2Pi}] /.
        DrawingTransform3D[#1 + 1 &, #2 + 2 &, #3 - 2 &]},
    Axes -> True,
    AxesLabel -> {x, y, z},
    ImageSize -> 400];

Draw3DItems[
    {SphericalDraw3D[2, {theta, 0, Pi}, {phi, 0, 2Pi}] //
        UseTranslateShape[{1, 2, -2}]},
    Axes -> True,
    AxesLabel -> {x, y, z},
    ImageSize -> 400];

With the above constructions you could easily add a number of different
spheres and other surfaces at various locations. DrawGraphics also allows
you to easily turn down the color saturation of the lighting and then use
various lighter surface colors for various spheres. Here are two different
spheres of different colors at two locations. I drew the polygon edges in a
slightly darker shade of the surface colors so they would be subdued.

Draw3DItems[
    {SurfaceColor[LightSteelBlue],
      EdgeForm[ColorMix[LightSteelBlue, Black][0.3]],
      SphericalDraw3D[1, {theta, 0, Pi}, {phi, 0, 2Pi}] //
        UseTranslateShape[{1, 2, -2}],

      SurfaceColor[LightCoral], EdgeForm[ColorMix[LightCoral, Black][0.3]],
      SphericalDraw3D[1, {theta, 0, Pi}, {phi, 0, 2Pi}] //
        UseTranslateShape[{2, 3, 1}]},

    NeutralLighting[0.3, 0.5, 0.1],
    Axes -> True,
    AxesLabel -> {x, y, z},
    Background -> Linen,
    ImageSize -> 400];


In regular Mathematica to plot a single sphere you could use...

Needs["Graphics`ParametricPlot3D`"]
Needs["Graphics`Shapes`"]

Show[TranslateShape[
      SphericalPlot3D[2, {theta, 0, Pi}, {phi, 0, 2Pi},
        DisplayFunction -> Identity], {1, 2, -2}],
    DisplayFunction -> $DisplayFunction];

David Park
djmp at earthlink.net
http://home.earthlink.net/~djmp/

From: nomad111 [mailto:g_h_111 at hotmail.com]
To: mathgroup at smc.vnet.net

hi every1
i really need to kno how to move the center of a circle in SphericalPlot3D.
I need the center at (1,2,-2) and any radius (say 5).
Appreciate any help

Regards,
nomad111



  • Prev by Date: Re: Re: Stylesheets vs. DTDs or XML Schemas
  • Next by Date: Re: Re: Pure Function for String Selection
  • Previous by thread: Re: Desperate help
  • Next by thread: Unsorted Union