Plot dots from table
-
- Posts: 10
- Joined: Fri Apr 06, 2018 8:08 pm
Plot dots from table
Hi,
i am getting an error in line 18:
@DISPLAY {Width = 640, Height = 480}
local facePoints = {
{-10, -20}, {-5, -20}, {0, -20}, {5, -20}, {10, -20},
{-15, -15}, {-10, -15}, {10, -15}, {15, -15},
{-15, -10}, {15, -10},
{-15, -5}, {15, -5},
{-20, 0}, {-15, 0}, {15, 0}, {20, 0},
{-20, 5}, {20, 5},
{-15, 10}, {15, 10},
{-15, 15}, {-10, 15}, {10, 15}, {15, 15},
{-10, 20}, {-5, 20}, {0, 20}, {5, 20}, {10, 20}
}
Function DrawFace()
For Local I = 1 To 30
Local x = facePoints[1]
Local y = facePoints[2]
Plot(x + 320, y + 240, 0xFFFFFF)
Next
EndFunction
DrawFace()
Repeat
WaitEvent
Forever
it says:
ou cannot use this reserved word here!
File: GAIA-X.HWS (current line: 18)
Also i am on an m1 mac and GL-Galore is not supported for arm. Shall i use hollywod for x64 than via rosetta ?
Seems so : ) I will try now
i am getting an error in line 18:
@DISPLAY {Width = 640, Height = 480}
local facePoints = {
{-10, -20}, {-5, -20}, {0, -20}, {5, -20}, {10, -20},
{-15, -15}, {-10, -15}, {10, -15}, {15, -15},
{-15, -10}, {15, -10},
{-15, -5}, {15, -5},
{-20, 0}, {-15, 0}, {15, 0}, {20, 0},
{-20, 5}, {20, 5},
{-15, 10}, {15, 10},
{-15, 15}, {-10, 15}, {10, 15}, {15, 15},
{-10, 20}, {-5, 20}, {0, 20}, {5, 20}, {10, 20}
}
Function DrawFace()
For Local I = 1 To 30
Local x = facePoints[1]
Local y = facePoints[2]
Plot(x + 320, y + 240, 0xFFFFFF)
Next
EndFunction
DrawFace()
Repeat
WaitEvent
Forever
it says:
ou cannot use this reserved word here!
File: GAIA-X.HWS (current line: 18)
Also i am on an m1 mac and GL-Galore is not supported for arm. Shall i use hollywod for x64 than via rosetta ?
Seems so : ) I will try now
Re: Plot dots from table
under windwos is says "wrond type" in Plot
since x and y are tables and not numbers, which is wrong
since x and y are tables and not numbers, which is wrong
Christos
-
- Posts: 10
- Joined: Fri Apr 06, 2018 8:08 pm
Re: Plot dots from table
Thanks,
changed it this way and now i get
"Constant not found! File: GAIA-X.HWS (current line: 16)"
My intention is to declare the number of field which would be 30.
@DISPLAY {Width = 640, Height = 480}
local facePoints = {
{x = -10, y = -20}, {x = -5, y = -20}, {x = 0, y = -20}, {x = 5, y = -20}, {x = 10, y = -20},
{x = -15, y = -15}, {x = -10, y = -15}, {x = 10, y = -15}, {x = 15, y = -15},
{x = -15, y = -10}, {x = 15, y = -10},
{x = -15, y = -5}, {x = 15, y = -5},
{x = -20, y = 0}, {x = -15, y = 0}, {x = 15, y = 0}, {x = 20, y = 0},
{x = -20, y = 5}, {x = 20, y = 5},
{x = -15, y = 10}, {x = 15, y = 10},
{x = -15, y = 15}, {x = -10, y = 15}, {x = 10, y = 15}, {x = 15, y = 15},
{x = -10, y = 20}, {x = -5, y = 20}, {x = 0, y = 20}, {x = 5, y = 20}, {x = 10, y = 20}
}
Function DrawFace()
For I = 1 To #facePoints
Local x = facePoints.x
Local y = facePoints.y
Plot(x + 320, y + 240, 0xFFFFFF)
Next
EndFunction
DrawFace()
Repeat
WaitEvent
Forever
changed it this way and now i get
"Constant not found! File: GAIA-X.HWS (current line: 16)"
My intention is to declare the number of field which would be 30.
@DISPLAY {Width = 640, Height = 480}
local facePoints = {
{x = -10, y = -20}, {x = -5, y = -20}, {x = 0, y = -20}, {x = 5, y = -20}, {x = 10, y = -20},
{x = -15, y = -15}, {x = -10, y = -15}, {x = 10, y = -15}, {x = 15, y = -15},
{x = -15, y = -10}, {x = 15, y = -10},
{x = -15, y = -5}, {x = 15, y = -5},
{x = -20, y = 0}, {x = -15, y = 0}, {x = 15, y = 0}, {x = 20, y = 0},
{x = -20, y = 5}, {x = 20, y = 5},
{x = -15, y = 10}, {x = 15, y = 10},
{x = -15, y = 15}, {x = -10, y = 15}, {x = 10, y = 15}, {x = 15, y = 15},
{x = -10, y = 20}, {x = -5, y = 20}, {x = 0, y = 20}, {x = 5, y = 20}, {x = 10, y = 20}
}
Function DrawFace()
For I = 1 To #facePoints
Local x = facePoints.x
Local y = facePoints.y
Plot(x + 320, y + 240, 0xFFFFFF)
Next
EndFunction
DrawFace()
Repeat
WaitEvent
Forever
Re: Plot dots from table
offcourse since there is not #facepoint constant
your logic is diffirent try this way
your logic is diffirent try this way
Code: Select all
@DISPLAY {Width = 640, Height = 480}
Local facePoints = {
{x = -10, y = -20}, {x = -5, y = -20}, {x = 0, y = -20}, {x = 5, y = -20}, {x = 10, y = -20},
{x = -15, y = -15}, {x = -10, y = -15}, {x = 10, y = -15}, {x = 15, y = -15},
{x = -15, y = -10}, {x = 15, y = -10},
{x = -15, y = -5}, {x = 15, y = -5},
{x = -20, y = 0}, {x = -15, y = 0}, {x = 15, y = 0}, {x = 20, y = 0},
{x = -20, y = 5}, {x = 20, y = 5},
{x = -15, y = 10}, {x = 15, y = 10},
{x = -15, y = 15}, {x = -10, y = 15}, {x = 10, y = 15}, {x = 15, y = 15},
{x = -10, y = 20}, {x = -5, y = 20}, {x = 0, y = 20}, {x = 5, y = 20}, {x = 10, y = 20}
}
Function iterate(Index,facePoint_table_item)
Plot(facePoint_table_item.x+320,facePoint_table_item.y+240,#RED)
EndFunction
ForEach(facepoints,iterate)
Repeat
WaitEvent
Forever
Christos
Re: Plot dots from table
You want to get X and Y from facepoints but that table has a lot of X and Y members.
Perhaps using facepoints[index].x or a foreach loop...
Perhaps using facepoints[index].x or a foreach loop...
Re: Plot dots from table
@phoenixkonsole
This works for me.
As tolkien wrote, you have to access each table member (0 to 29) which are also each one a table with 2 members (0 and 1).
Regards
This works for me.
Code: Select all
@DISPLAY {Width = 640, Height = 480}
local facePoints = {
{-10, -20},
{-5, -20},
{0, -20},
{5, -20},
{10, -20},
{-15, -15},
{-10, -15},
{10, -15},
{15, -15},
{-15, -10},
{15, -10},
{-15, -5},
{15, -5},
{-20, 0},
{-15, 0},
{15, 0},
{20, 0},
{-20, 5},
{20, 5},
{-15, 10},
{15, 10},
{-15, 15},
{-10, 15},
{10, 15},
{15, 15},
{-10, 20},
{-5, 20},
{0, 20},
{5, 20},
{10, 20}
}
Function DrawFace()
For Local i = 0 To 29
Local x = facePoints[i][0]
Local y = facePoints[i][1]
Plot(x + 320, y + 240, 0xFFFFFF)
Next
EndFunction
DrawFace()
Repeat
WaitEvent
Forever
Regards
PowerBook 5.2 MorphOS 3.15
PowerBook 5.8 MorphOS 3.15
Amiga 1200 BPPC/BVision AOS4.1 FE
PowerBook 5.8 MorphOS 3.15
Amiga 1200 BPPC/BVision AOS4.1 FE
Re: Plot dots from table
And replace
by
Code: Select all
For Local i = 0 To 29
Code: Select all
For Local i = 0 To TableItems(facePoints)-1
-
- Posts: 10
- Joined: Fri Apr 06, 2018 8:08 pm
Re: Plot dots from table
Thank you guys. I played further and got it to work and no i try to the dots to move from center to outside and back...
First thought doesnt work. I need to sleep
@DISPLAY {Width = 640, Height = 480}
; 2D-Koordinaten für das weibliche Gesicht
Dim facePoints[250]
; Punkte für ein weibliches Gesicht definieren
facePoints[1] = {x = 0, y = -40}; ; Stirn
facePoints[2] = {x = -20, y = -30}; ; Linkes Auge
facePoints[3] = {x = -10, y = -30};
facePoints[4] = {x = 10, y = -30}; ; Rechtes Auge
facePoints[5] = {x = 20, y = -30};
facePoints[6] = {x = -20, y = -20}; ; Linkes Nasenloch
facePoints[7] = {x = -10, y = -20};
facePoints[8] = {x = 10, y = -20}; ; Rechtes Nasenloch
facePoints[9] = {x = 20, y = -20};
facePoints[10] = {x = -40, y = 0}; ; Linke Mundseite
facePoints[11] = {x = -30, y = 0};
facePoints[12] = {x = -20, y = 0};
facePoints[13] = {x = -10, y = 0};
facePoints[14] = {x = 10, y = 0}; ; Rechte Mundseite
facePoints[15] = {x = 20, y = 0};
facePoints[16] = {x = 30, y = 0};
facePoints[17] = {x = 40, y = 0};
facePoints[18] = {x = -30, y = 10}; ; Linke Wangenpartie
facePoints[19] = {x = -20, y = 10};
facePoints[20] = {x = -10, y = 10};
facePoints[21] = {x = 10, y = 10}; ; Rechte Wangenpartie
facePoints[22] = {x = 20, y = 10};
facePoints[23] = {x = 30, y = 10};
facePoints[24] = {x = -30, y = 20}; ; Linke Gesichtskontur
facePoints[25] = {x = -20, y = 20};
facePoints[26] = {x = -10, y = 20};
facePoints[27] = {x = 10, y = 20}; ; Rechte Gesichtskontur
facePoints[28] = {x = 20, y = 20};
facePoints[29] = {x = 30, y = 20};
facePoints[30] = {x = -20, y = 30}; ; Kinn
facePoints[31] = {x = -10, y = 30};
facePoints[32] = {x = 10, y = 30};
facePoints[33] = {x = 20, y = 30};
facePoints[34] = {x = -10, y = -40}; ; Linkes Augebrauenende
facePoints[35] = {x = 10, y = -40}; ; Rechtes Augenbrauenende
facePoints[36] = {x = -15, y = -25}; ; Linker Nasenflügel
facePoints[37] = {x = 15, y = -25}; ; Rechter Nasenflügel
facePoints[38] = {x = -25, y = -5}; ; Linke Nasenwurzel
facePoints[39] = {x = 25, y = -5}; ; Rechte Nasenwurzel
facePoints[40] = {x = -30, y = 10}; ; Linke Mundwinkel
facePoints[41] = {x = -20, y = 10};
facePoints[42] = {x = -10, y = 10};
facePoints[43] = {x = 10, y = 10}; ; Rechte Mundwinkel
facePoints[44] = {x = 20, y = 10};
facePoints[45] = {x = 30, y = 10};
facePoints[46] = {x = -30, y = 20}; ; Linke Wangenpartie
facePoints[47] = {x = -20, y = 20};
facePoints[48] = {x = -10, y = 20};
facePoints[49] = {x = 10, y = 20}; ; Rechte Wangenpartie
facePoints[50] = {x = 20, y = 20};
facePoints[51] = {x = 30, y = 20};
facePoints[52] = {x = -30, y = 30}; ; Linke Gesichtskontur
facePoints[53] = {x = -20, y = 30};
facePoints[54] = {x = -10, y = 30};
facePoints[55] = {x = 10, y = 30}; ; Rechte Gesichtskontur
facePoints[56] = {x = 20, y = 30};
facePoints[57] = {x = 30, y = 30};
facePoints[58] = {x = -20, y = 40}; ; Kinn
facePoints[59] = {x = -10, y = 40};
facePoints[60] = {x = 10, y = 40};
facePoints[61] = {x = 20, y = 40};
facePoints[62] = {x = -5, y = -50}; ; Nasenspitze
facePoints[63] = {x = 0, y = -55}; ; Nasenspitze
facePoints[64] = {x = 5, y = -50}; ; Nasenspitze
facePoints[65] = {x = -20, y = -35}; ; Nasenrücken
facePoints[66] = {x = 20, y = -35}; ; Nasenrücken
facePoints[67] = {x = -35, y = -10}; ; Linke Nasenseite
facePoints[68] = {x = 35, y = -10}; ; Rechte Nasenseite
facePoints[69] = {x = -40, y = 0}; ; Linke Mundseite
facePoints[70] = {x = -35, y = 0};
facePoints[71] = {x = -30, y = 0};
facePoints[72] = {x = 30, y = 0}; ; Rechte Mundseite
facePoints[73] = {x = 35, y = 0};
facePoints[74] = {x = 40, y = 0};
facePoints[75] = {x = -35, y = 10}; ; Linke Mundwinkel
facePoints[76] = {x = -25, y = 10};
facePoints[77] = {x = -15, y = 5}; ; Linkes Ohr
facePoints[78] = {x = 15, y = 5}; ; Rechtes Ohr
facePoints[79] = {x = 25, y = 10};
facePoints[80] = {x = 35, y = 10};
facePoints[81] = {x = -20, y = 20}; ; Linke Wangenknochen
facePoints[82] = {x = 20, y = 20}; ; Rechte Wangenknochen
facePoints[83] = {x = -10, y = 30}; ; Linke Schläfe
facePoints[84] = {x = 10, y = 30}; ; Rechte Schläfe
facePoints[85] = {x = -5, y = 45}; ; Linke Augenbraue
facePoints[86] = {x = 5, y = 45}; ; Rechte Augenbraue
facePoints[87] = {x = -10, y = 50}; ; Linke Augenbraue
facePoints[88] = {x = 10, y = 50}; ; Rechte Augenbraue
facePoints[89] = {x = -15, y = 55}; ; Linke Augenbraue
facePoints[90] = {x = 15, y = 55}; ; Rechte Augenbraue
facePoints[91] = {x = -20, y = 60}; ; Linke Augenbraue
facePoints[92] = {x = 20, y = 60}; ; Rechte Augenbraue
facePoints[93] = {x = -10, y = 45}; ; Linke Augenlider
facePoints[94] = {x = 10, y = 45}; ; Rechte Augenlider
facePoints[95] = {x = -20, y = 40}; ; Linke Augenlider
facePoints[96] = {x = 20, y = 40}; ; Rechte Augenlider
facePoints[97] = {x = -25, y = 35}; ; Linke Augenlider
facePoints[98] = {x = 25, y = 35}; ; Rechte Augenlider
facePoints[99] = {x = -30, y = 30}; ; Linke Augenlider
facePoints[100] = {x = 30, y = 30}; ; Rechte Augenlider
; Farbe für das Gesicht deklarieren
Local faceColor = 0xFFFFFF
; Maximale Auflösung und Durchmesser der Punktwolke
Local maxResolution = 480
Local maxDiameter = maxResolution / 3
; Funktion zum Zeichnen des Gesichts
Function DrawFace(radius)
Local centerX = DisplayWidth() / 2
Local centerY = DisplayHeight() / 2
For I = 1 To 100
Local x = centerX + facePoints.x * radius
Local y = centerY + facePoints.y * radius
Plot(x, y, faceColor)
Next
EndFunction
; Animation der Sphere
Local animationTime = 5 ; Zeit in Sekunden für eine vollständige Animation
Local startTime = TimeSec()
Local currentTime
Repeat
currentTime = TimeSec()
Local elapsedTime = currentTime - startTime
Local t = elapsedTime / animationTime
If t > 1 Then startTime = currentTime: t = 0
Local radius = maxDiameter * (1 - t)
DrawFace(radius)
WaitEvent
Forever
First thought doesnt work. I need to sleep
@DISPLAY {Width = 640, Height = 480}
; 2D-Koordinaten für das weibliche Gesicht
Dim facePoints[250]
; Punkte für ein weibliches Gesicht definieren
facePoints[1] = {x = 0, y = -40}; ; Stirn
facePoints[2] = {x = -20, y = -30}; ; Linkes Auge
facePoints[3] = {x = -10, y = -30};
facePoints[4] = {x = 10, y = -30}; ; Rechtes Auge
facePoints[5] = {x = 20, y = -30};
facePoints[6] = {x = -20, y = -20}; ; Linkes Nasenloch
facePoints[7] = {x = -10, y = -20};
facePoints[8] = {x = 10, y = -20}; ; Rechtes Nasenloch
facePoints[9] = {x = 20, y = -20};
facePoints[10] = {x = -40, y = 0}; ; Linke Mundseite
facePoints[11] = {x = -30, y = 0};
facePoints[12] = {x = -20, y = 0};
facePoints[13] = {x = -10, y = 0};
facePoints[14] = {x = 10, y = 0}; ; Rechte Mundseite
facePoints[15] = {x = 20, y = 0};
facePoints[16] = {x = 30, y = 0};
facePoints[17] = {x = 40, y = 0};
facePoints[18] = {x = -30, y = 10}; ; Linke Wangenpartie
facePoints[19] = {x = -20, y = 10};
facePoints[20] = {x = -10, y = 10};
facePoints[21] = {x = 10, y = 10}; ; Rechte Wangenpartie
facePoints[22] = {x = 20, y = 10};
facePoints[23] = {x = 30, y = 10};
facePoints[24] = {x = -30, y = 20}; ; Linke Gesichtskontur
facePoints[25] = {x = -20, y = 20};
facePoints[26] = {x = -10, y = 20};
facePoints[27] = {x = 10, y = 20}; ; Rechte Gesichtskontur
facePoints[28] = {x = 20, y = 20};
facePoints[29] = {x = 30, y = 20};
facePoints[30] = {x = -20, y = 30}; ; Kinn
facePoints[31] = {x = -10, y = 30};
facePoints[32] = {x = 10, y = 30};
facePoints[33] = {x = 20, y = 30};
facePoints[34] = {x = -10, y = -40}; ; Linkes Augebrauenende
facePoints[35] = {x = 10, y = -40}; ; Rechtes Augenbrauenende
facePoints[36] = {x = -15, y = -25}; ; Linker Nasenflügel
facePoints[37] = {x = 15, y = -25}; ; Rechter Nasenflügel
facePoints[38] = {x = -25, y = -5}; ; Linke Nasenwurzel
facePoints[39] = {x = 25, y = -5}; ; Rechte Nasenwurzel
facePoints[40] = {x = -30, y = 10}; ; Linke Mundwinkel
facePoints[41] = {x = -20, y = 10};
facePoints[42] = {x = -10, y = 10};
facePoints[43] = {x = 10, y = 10}; ; Rechte Mundwinkel
facePoints[44] = {x = 20, y = 10};
facePoints[45] = {x = 30, y = 10};
facePoints[46] = {x = -30, y = 20}; ; Linke Wangenpartie
facePoints[47] = {x = -20, y = 20};
facePoints[48] = {x = -10, y = 20};
facePoints[49] = {x = 10, y = 20}; ; Rechte Wangenpartie
facePoints[50] = {x = 20, y = 20};
facePoints[51] = {x = 30, y = 20};
facePoints[52] = {x = -30, y = 30}; ; Linke Gesichtskontur
facePoints[53] = {x = -20, y = 30};
facePoints[54] = {x = -10, y = 30};
facePoints[55] = {x = 10, y = 30}; ; Rechte Gesichtskontur
facePoints[56] = {x = 20, y = 30};
facePoints[57] = {x = 30, y = 30};
facePoints[58] = {x = -20, y = 40}; ; Kinn
facePoints[59] = {x = -10, y = 40};
facePoints[60] = {x = 10, y = 40};
facePoints[61] = {x = 20, y = 40};
facePoints[62] = {x = -5, y = -50}; ; Nasenspitze
facePoints[63] = {x = 0, y = -55}; ; Nasenspitze
facePoints[64] = {x = 5, y = -50}; ; Nasenspitze
facePoints[65] = {x = -20, y = -35}; ; Nasenrücken
facePoints[66] = {x = 20, y = -35}; ; Nasenrücken
facePoints[67] = {x = -35, y = -10}; ; Linke Nasenseite
facePoints[68] = {x = 35, y = -10}; ; Rechte Nasenseite
facePoints[69] = {x = -40, y = 0}; ; Linke Mundseite
facePoints[70] = {x = -35, y = 0};
facePoints[71] = {x = -30, y = 0};
facePoints[72] = {x = 30, y = 0}; ; Rechte Mundseite
facePoints[73] = {x = 35, y = 0};
facePoints[74] = {x = 40, y = 0};
facePoints[75] = {x = -35, y = 10}; ; Linke Mundwinkel
facePoints[76] = {x = -25, y = 10};
facePoints[77] = {x = -15, y = 5}; ; Linkes Ohr
facePoints[78] = {x = 15, y = 5}; ; Rechtes Ohr
facePoints[79] = {x = 25, y = 10};
facePoints[80] = {x = 35, y = 10};
facePoints[81] = {x = -20, y = 20}; ; Linke Wangenknochen
facePoints[82] = {x = 20, y = 20}; ; Rechte Wangenknochen
facePoints[83] = {x = -10, y = 30}; ; Linke Schläfe
facePoints[84] = {x = 10, y = 30}; ; Rechte Schläfe
facePoints[85] = {x = -5, y = 45}; ; Linke Augenbraue
facePoints[86] = {x = 5, y = 45}; ; Rechte Augenbraue
facePoints[87] = {x = -10, y = 50}; ; Linke Augenbraue
facePoints[88] = {x = 10, y = 50}; ; Rechte Augenbraue
facePoints[89] = {x = -15, y = 55}; ; Linke Augenbraue
facePoints[90] = {x = 15, y = 55}; ; Rechte Augenbraue
facePoints[91] = {x = -20, y = 60}; ; Linke Augenbraue
facePoints[92] = {x = 20, y = 60}; ; Rechte Augenbraue
facePoints[93] = {x = -10, y = 45}; ; Linke Augenlider
facePoints[94] = {x = 10, y = 45}; ; Rechte Augenlider
facePoints[95] = {x = -20, y = 40}; ; Linke Augenlider
facePoints[96] = {x = 20, y = 40}; ; Rechte Augenlider
facePoints[97] = {x = -25, y = 35}; ; Linke Augenlider
facePoints[98] = {x = 25, y = 35}; ; Rechte Augenlider
facePoints[99] = {x = -30, y = 30}; ; Linke Augenlider
facePoints[100] = {x = 30, y = 30}; ; Rechte Augenlider
; Farbe für das Gesicht deklarieren
Local faceColor = 0xFFFFFF
; Maximale Auflösung und Durchmesser der Punktwolke
Local maxResolution = 480
Local maxDiameter = maxResolution / 3
; Funktion zum Zeichnen des Gesichts
Function DrawFace(radius)
Local centerX = DisplayWidth() / 2
Local centerY = DisplayHeight() / 2
For I = 1 To 100
Local x = centerX + facePoints.x * radius
Local y = centerY + facePoints.y * radius
Plot(x, y, faceColor)
Next
EndFunction
; Animation der Sphere
Local animationTime = 5 ; Zeit in Sekunden für eine vollständige Animation
Local startTime = TimeSec()
Local currentTime
Repeat
currentTime = TimeSec()
Local elapsedTime = currentTime - startTime
Local t = elapsedTime / animationTime
If t > 1 Then startTime = currentTime: t = 0
Local radius = maxDiameter * (1 - t)
DrawFace(radius)
WaitEvent
Forever
Re: Plot dots from table
First, please put you code into code tags [code] [/code] (in the forum editor use the </> symbol to insert it, don't copy it from here).
Then your code is incomplete, some functions are missing (TimeSec, DisplayHeight, DisplayWidth), so it is difficult to follow your ideas.
Then your function DrawFace() is incorrect. I would suggest, first to make a working drawing function instead to write a lot of code you can't test because the basics are incomplete. The lines
should use your index I
Then I think, you made a mistake in your algorithm for radius. Your DrawFace function expects a factor, but you call it with a size in pixels.
The line seems to contain syntax from another language.
And finally, your animation loop cannot work because it waits for an event that will never come, because you did not initialize one.
I would put your timer arithmetic into an interval function. Look at this example how it can be done:
Ralf
Then your code is incomplete, some functions are missing (TimeSec, DisplayHeight, DisplayWidth), so it is difficult to follow your ideas.
Then your function DrawFace() is incorrect. I would suggest, first to make a working drawing function instead to write a lot of code you can't test because the basics are incomplete. The lines
Code: Select all
Local x = centerX + facePoints.x * radius
Local y = centerY + facePoints.y * radius
Code: Select all
Local x = centerX + facePoints[I].x * radius
Local y = centerY + facePoints[I].y * radius
The line
Code: Select all
If t > 1 Then startTime = currentTime: t = 0
And finally, your animation loop cannot work because it waits for an event that will never come, because you did not initialize one.
I would put your timer arithmetic into an interval function. Look at this example how it can be done:
Code: Select all
Function p_Main(msg)
DebugPrint(msg.Timestamp)
EndFunction
SetInterval(1, p_Main, 1000)
Repeat
WaitEvent
Forever
Re: Plot dots from table
And I forgot: I think the facePoints table structure from emeck would be the better solution than yours, because you declare in the subtables 200 unnecessary x and y variables instead of only 200 values.
Ralf
Ralf