Silverfrost Forums

Welcome to our forums

3D graphics in clearwin

30 Mar 2009 2:37 #4380

hello, I am presently working on simple plot and trying to draw poly lines with x,y,z array of coordinates. For eg the coordinates are as follows

   x             y             z                   h

-5.238 0.012 0.558 66666 -5.238 0.032 0.648 66666 -5.238 0.123 0.765 99999 1.258 1.230 1.258 66666 1.258 1.342 1.526 66666 ......... and so on

when value of h is 99999 the pen plotter should move to x value (for eg 1.258 in this case) and continue drawing poly line until next h value(99999).

the subroutine VSPLDR(x,y,z,npts) draws poly lines in continuously,but i have do draw polylines in broken fashion.Any help on this issue is appreciated. thank you

4 Apr 2009 12:54 #4402

As you appear to be drawing a general purpose graphic, and not a graph with all the associated axes, labelling etc, I suggest that you do not use SimplePlot, but instead use the graphics primitives in Clearwin+.

It isn't clear if you want to draw your line segment by segment, in which case you should use CALL DRAW_LINE_BETWEEN@ instead of DRAW_POLYLINE@. or if you want to draw with a dashed or dotted line, which you can select with SET_LINE_STYLE@ (and maybe also with SET_LINE_WIDTH@).

You have a further option to use OpenGL

Eddie

6 Apr 2009 3:41 #4404

Thank you for your reply. but i am drawing polylines making use of x,y,z points. the subroutines you specified has arguments for only x,y .does clearwin has subroutines that are used to draw 3D drawings. any help on this is appreciated. thank you.

6 Apr 2009 10:50 #4405

Hi,

On screen, you can only see 2D. If you have a 3D object, and wish to draw it with ClearWin primitives, then you have to sort out the orientation, any perspective, and then the 'z-order'. This is difficult, so I appreciate your reluctance to do it, and your preference for a system that does it for you.

If you are just drawing lines, as a pen plotter would do, then you can just draw the lot. This works reasonably well if there are not too many lines. The transformation from x,y,z to a viewport x', y' coordinate system isn't too complicated, especially if perspective isn't involved (e.g. if you are drawing an isometric view). The transformations are dealt with in a lot of books, e.g. Angell & Griffith's book. Hidden line removal is always difficult.

However, if you program in OpenGL, you get the whole 3D library with far more sophisticated facilities for shading etc. FTN95 interfaces extremely well with OpenGL from what I have seen. The problem is that OpenGL is a lot more complicated than SimplePlot - and the instructions in FTN95.chm are basic, to say the least! Several other forum users program in OpenGL and they may recommend a book.

Eddie

Please login to reply.