wanted to create a simple metric with vertical marks and distance on x and y axes, any help is welcome, thanks
regards frank
#compact
includepath "$\inc\"
$ FileName "t.exe"
'include "RTL32.inc"
'include "RTL64.inc"
$ title "Create_Lines with Coordinates"
include "OpenglSceneFrame.inc"
sub initialize(sys hWnd)
'=======================
end sub
'
sub scene(sys hWnd)
'==================
'
static single s1,s2,s3,s4,ang1,angi1=1,ra,ri
sys i
'
glLoadIdentity
glClear GL_COLOR_BUFFER_BIT or GL_DEPTH_BUFFER_BIT
glClearColor 0.5, 0, 0, 0
'
'glrotatef ang1, 0,0,1
gltranslatef 0,0,-1
glscalef 0.001,0.001,0.001
'
glLineWidth 3.0
'
glBegin GL_LINES
glColor4ub 250,250,150,250
glVertex2i -100,-100
glVertex2i 100, 100
glColor4ub 150,250,250,250
glVertex2i -100, 100
glVertex2i 100,-100
glEnd
'
glLineWidth 2.0
'
ri=0
glBegin GL_LINE_LOOP
for i=0 to 360 step 10
ra=rad(i)
glVertex2f cos(ra)*(170+ri),sin(ra)*(170+ri)
ri=30-ri
next
glEnd
'-------------------------------------------------------------
'---'---'---'---'---'---'---'
glLineWidth 1.0
'
glBegin GL_LINES
glColor4ub 250,250,250,0
glColor4ub 0,0,0,0
' -- Marks on axes vertical
for i = -450 to 450
glVertex2i i, -10
glVertex2i i, 10
glVertex2i -10, i
glVertex2i 10, i
next
glEnd
glBegin GL_LINES
glColor4ub 250,50,0,0
' -- X axis
glVertex2i -500,0
glVertex2i 500,0
'-- Y axis
glVertex2i 0,500
glVertex2i 0,-500
glEnd
'---'---'---'---'---'---'---'
'----------------------------------------------------------------
'
ang1+=angi1
if ang1>360 then ang1-=360
'
end sub
sub Release(sys hwnd)
'====================
end sub