Graphical drawing in CM3? #1147
Replies: 4 comments 1 reply
-
CM3 has many packages, there must be graphics packages. But I don't know which is and how to use. The package has no documentation, I think you will have read the code to understand what they are doing and how to use them. Packages don't have the licensing information with them too, so using them with your own risks. CM3 is fun to play with but a real headache to master. |
Beta Was this translation helpful? Give feedback.
-
M3 has actually a very interesting graphics library, or more correct a UI library that is even cross-platform for X11 and Windows. And at least for X11 this library from the 90th works fine. Very much worth a look. http://modula3.github.io/cm3/tutorial/ui/tutorial.html There is an example how to draw lines, however it is all included in the UI, less focussed on graphics. I have played a bit with it to write a Mandelbrot program which does not use all the interactive stuff and focuses on graphics, actually just setting a point. I will post an example later. |
Beta Was this translation helpful? Give feedback.
-
Trestle is a GUI library, but I think it can also be used for the kind of graphics that is used in the BASIC example. I am sure I am not using it in the best way, but it works. Here is an example how to set a point: Not sure if there is a better way, though. Once you can draw points, you can also draw a line by adding a DrawLine procedure and whatever you need. It can be fun to write these procedures yourself. Every graphics introduction has the algorithm. However there is an other example how to draw Lines here in the tutorial:fast With that and a bit of rearranging things the BASIC example should already be possible. |
Beta Was this translation helpful? Give feedback.
-
For Windows work good too. Drawing lines You can see in Cube.exe |
Beta Was this translation helpful? Give feedback.
-
I come from BASIC, where we have a lot of built-in routines to draw beautiful looking graphics like this:
https://github.com/smallbasic/SmallBASIC/blob/master/samples/distro-examples/graphics/3dtorus.bas
I know CM3 will not have such built-in routines but there should be packages providing such functionality isn't it?
Beta Was this translation helpful? Give feedback.
All reactions