RE: 3d Graphics problem
- To: mathgroup at smc.vnet.net
- Subject: [mg28952] RE: [mg28939] 3d Graphics problem
- From: "David Park" <djmp at earthlink.net>
- Date: Mon, 21 May 2001 00:43:39 -0400 (EDT)
- Sender: owner-wri-mathgroup at wolfram.com
Francisco, Your main problem is that you do not have a proper Viewpoint for showing the line. The line is behind the Polygon. The following works. Show[{gg1, gg2}, ViewPoint -> {-0.798, -3.080, -1.153}]; I have found that producing various graphics elements and then combining them with the Show statement is often quite confusing. In your case, you can build up the entire piece of graphics within one cell, simply by drawing the elements one after the other and using the desired graphics directives. I have taken your example, made the line double thickness, and added differently colored points at the ends of the line and the corners of the polygon. This is how I would do it: Needs["Graphics`Colors`"] Module[{poly, line, pts1, pts2}, line = Line[{{0.4, 0.3, 0.2}, {0.7, 0.15, 0.15}}]; poly = Polygon[{{1, 0, 0}, {0, 1, 0}, {0, 0, 1}}]; pts1 = Point /@ line[[1]]; pts2 = Point /@ poly[[1]]; Show[Graphics3D[ {poly, Blue, AbsoluteThickness[2], line, AbsolutePointSize[6], Red, pts1, Peacock, pts2}], AspectRatio -> Automatic, PlotRange -> Automatic, {ViewPoint -> {-0.798, -3.08, -1.153}}]]; If you use the DrawingCube package, at my web site, you can stay with the same paradigm and even add in curves and surfaces produced by any 3D plot routines. For example, you just use ParametricDraw3D instead of ParametricPlot3D. David Park djmp at earthlink.net http://home.earthlink.net/~djmp/ > From: FRANCISCO GUTIERREZ [mailto:rpena at elsitio.net.co] To: mathgroup at smc.vnet.net > > Dear NG: > I have the following problem. I want to draw a 2D simplex in a 3D space, > and within the simplex some points and lines. > > First I create the line: > gg1 = Graphics3D[Line[{{0.4, 0.3, 0.2}, {0.7, 0.15, 0.15}}]] > The the simplex: > gg2 = Graphics3D[Polygon[{{1, 0, 0}, {0, 1, 0}, {0, 0, 1}}]] > Then I visualize both: > Show[{gg1, gg2}, ViewPoint -> {1, 1.5, 2.5}] > The line isn't visible. When I draw points, they are not visible either. > If I give options to the line (thickness, or RGBColor) or to the points, I > get an error message. > How should I proceed? > Thanks, > Fg >