- #1
kevin86
- 20
- 0
Anyone know the codes to draw polygons in fortran. Actually a few points work too.
Jeff Reid said:Before the days of graphic interfaces, us old Fortran programmers would print graphs on line printers. We would create a coordinate system based on the points of a printer, 10 characters per inch horizontal, 6 lines per inch vertical. Horizontal was limited to 120 or 132 characters, but vertical was unlimited (OK, may limited to one box of paper). Then using a matrix to represent the paper, we would fill in the "dots", and then print it out. To save memory, a single horizontal vector could be used, and what ever functions invovled were used to calculate the "dots" for that rows worth of vertical displacement.
I would assume that modern day Fortran programs with access to graphics mode on monitors would have a draw line function, as they did back in the days of plotters.
The last graphics monitors I'm aware of were used in arcade games. These could only draw straight lines, and were called vector monitors. In Battlezone, you drove in a tank and all objects were 3-d wire frames."Graphics mode on monitors"? That's when the going was good!
ross26 said:Junglepeanut,
I've been trying to figure our how to call gnuplot from inside my Fortran77 program to save manually opening the dump file and choosing all the plotting parameters each time i want to view the program output. Any idea if / how I can do this?!
novice Ross
Jeff Reid said:You could dump out a text file of numbers and then use a spreadsheet program to import and plot the numbers.
Fortran (short for Formula Translation) is a programming language commonly used for scientific and engineering applications. It was developed in the 1950s and is still widely used today.
To draw polygons using Fortran, you will need to use a graphics library such as OpenGL or DirectX. These libraries provide functions and procedures for drawing geometric shapes, including polygons.
Yes, Fortran can handle complex polygons with the help of graphics libraries. These libraries have functions for creating and manipulating complex shapes, such as polygons with holes or self-intersecting polygons.
It can be challenging to draw polygons using Fortran, especially for beginners. However, with the help of graphics libraries and proper understanding of the language, it is possible to create complex and visually appealing polygons.
Yes, there are many resources available for learning how to draw polygons using Fortran. Online tutorials, books, and forums are great places to start. You can also refer to the documentation of the graphics library you are using for specific instructions on drawing polygons.