BBC Basic:无法在屏幕上绘制矩形 [英] BBC Basic: Cannot plot rectangle on screen
问题描述
我遇到了一些麻烦图形命令,并想知道是否有人可以指出我在正确的方向...我写了下面的测试程序,在屏幕上画一个矩形:
10 CLS
20 MODE 5
30 MOVE 0,0
40 PLOT 97,100,100
当我运行这个程序时,程序完成,但没有绘制矩形(我可以看到)。我使用同轴电缆连接到CRT电视,但我不相信光标正在屏幕外显示,因为我试着调整X / Y值来检查这一点。
我在测试程序中犯了错误吗?是否可能存在已知的硬件故障,我应该检查一下?解析方案
有一个简单的解释:PLOT 97(绘制矩形)是没有在原来的BBC微型模型B上实现 - 它使用的PLOT代码只能达到87.我不能完全确定何时引入PLOT 96-103,它可能是Model B +或BBC Master。
在模型B上,您必须将矩形绘制为两个三角形(这里位于屏幕的中心):
10模式5
20 MOVE 592,462
30 PLOT 0,0,50
40 PLOT 81,50,-50
50 PLOT 81,0,50
Richard。
I recently got my hands on a BBC Micro (model B), and been playing around with it as a hobby project.
I'm having some trouble with the graphics commands, and was wondering if anyone could point me in the right direction... I have written the following test program to draw a rectangle on the screen:
10 CLS
20 MODE 5
30 MOVE 0,0
40 PLOT 97,100,100
When I run this, the program completes but no rectangle is drawn (that I can see). I'm using a coaxial cable to connect to a CRT TV, but I don't believe the cursor is drawing off-screen because I've tried adjusting the X/Y values to check for this.
Have I made a mistake in my test program? Is there possibly a known hardware fault that I should check for?
There's a simple explanation: PLOT 97 (draw rectangle) was not implemented on the original BBC Micro Model B - that used PLOT codes only up to 87. I'm not absolutely certain when PLOT 96-103 were introduced, it may have been the Model B+ or the BBC Master.
On a Model B you must draw the rectangle as two triangles (here in the centre of the screen):
10 MODE 5
20 MOVE 592,462
30 PLOT 0,0,50
40 PLOT 81,50,-50
50 PLOT 81,0,50
Richard.
这篇关于BBC Basic:无法在屏幕上绘制矩形的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!