Login
Back to forumSee the full topicGo to last reply

Posted By

MMS
on 2017-03-18
06:11:00
 Re: Use of CIRCLE command in Multicolor Mode

Sorry to answer to this, as I am not a graphic master, just to share what I learned from the books happy

Plus/4 Programmers reference guide Page 23:
(as a conclusion: even in HIRES mode you need a little smaller vertical diamater to get a real circle instead of oval)

"4. Vertical radius is the distance from the center of the shape to the top and
bottom of the shape. Because vertical dots on the high-resolution graphic screen
are slightly farther apart than horizontal dots are, when the vertical and horizon
tal radii have the same value, the shape drawn is an oval, not a circle. To draw a
circle, the vertical radius must be scaled to the horizontal radius (e.g., 50 horizon
tal, 47 vertical). For multicolor coordinates, 25 horizontal is about 47 vertical."


I think that if you want to keep the same commands irrespective of the mode you use (or do not know in advance), you may use the SCALE command.
In fact I've never understood how it could be really useful, maybe in a CAD program? :-D

Programmer's reference Guide:

"The SCALE command lets you change these values to 1024 logical dots both
across and down in any mode.
In particular, this is useful when you are unsure whether a final program will
run in high-resolution or in multicolor mode. If you do all the drawing with
SCALE on, the figures will be the same size in either mode. No coordinate
transformations are required to move between high resolution and multicolor
SCALEd coordinates.
The SCALE command may be executed at any time and remains in effect until
canceled.
After you turn on scaling, you must adapt the drawing commands to the new
screen coordinates. For example, the center of the high-res screen is no longer
160,100. It is now 512,512.
To calculate SCALEd values from high resolution or multicolor coordinates,
use these formulas:
High-res rows 5.12 * row coordinate
High-res columns 3.2 * column coordinate
Multicolor rows 5.12 * row coordinate
Multicolor columns 6.4 * column coordinate

For example, to get the same circle as drawn without SCALE by
CIRCLE, 160,100,60,50, you can use the following lines with SCALE:

5 SCALE 1
10 A = 3.2 * 160: B = 5.1S * 100
20 C = 3.2 * 60: D = 5.12 * 50
30 GRAPHIC 2,1
40 CIRCLEA3,C,D"




Back to top


Copyright © Plus/4 World Team, 2001-2024