next up previous contents index
Next: 5.5.4 Sub-windows Up: 5.5 3D Plotting Previous: 5.5.2 Specialized 3D Plotting

5.5.3 Mixing 2D and 3D graphics

When one uses 3D plotting function, default graphic boundaries are fixed, but in R3. If one wants to use graphic primitives to add informations on 3D graphics, the geom3d function can be used to convert 3D coordinates to 2D-graphics coordinates. The figure  5.11 illustrates this feature.

xinit('d7-10.ps');
   r=(%pi):-0.01:0;x=r.*cos(10*r);y=r.*sin(10*r);
   deff("[z]=surf(x,y)","z=sin(x)*cos(y)");
   t=%pi*(-10:10)/10;
   fplot3d(t,t,surf,35,45,"X@Y@Z",[-3,2,3]);
   z=sin(x).*cos(y);
   [x1,y1]=geom3d(x,y,z);
   xpoly(x1,y1,"lines");
   [x1,y1]=geom3d([0,0],[0,0],[5,0]);
   xsegs(x1,y1);
   xstring(x1(1),y1(1),' The point (0,0,0)');

Figdirfigures/

  
Figure 5.11: 2D and 3D plot
\begin{figure}
\begin{center}
\fbox{\begin{picture}
(300.0,212.0)
\special{ps...
.../d710.epsf hscale=100.0 vscale=100.0}
\end{picture}} \end{center}
\end{figure}


next up previous contents index
Next: 5.5.4 Sub-windows Up: 5.5 3D Plotting Previous: 5.5.2 Specialized 3D Plotting
Scilab Group