Omnimaga: The Coders Of Tomorrow
Welcome, Guest. Please login or register.
 
Omnimaga: The Coders Of Tomorrow
23 May, 2013, 11:44:34 *
Welcome, Guest. Please login or register.

Login with username, password and session length
 
   home   news downloads projects tutorials misc forums rules new posts irc about Login Register  
+-OmnomIRC

You must Register, be logged in and have at least 40 posts to use this shout-box! If it still doesn't show up afterward, it might be that OmnomIRC is disabled for your group or under maintenance.

Note: You can also use an IRC client like mIRC, X-Chat or Mibbit to connect to an EFnet server and #omnimaga.

Pages: 1 2 3 [4]   Go Down
  Print  
Author Topic: [Lua] Tiny3D -  (Read 3027 times) Bookmark and Share
0 Members and 1 Guest are viewing this topic.
flyingfisch
I'm 1337 now!
LV10 31337 u53r (Next: 2000)
**********
Offline Offline

Gender: Male
Last Login: Yesterday at 23:45:21
Date Registered: 26 August, 2011, 21:18:14
Location: OH, USA
Posts: 1497


Total Post Ratings: +74

View Profile WWW
« Reply #45 on: 24 October, 2011, 04:20:24 »
0

It's supposed to be almost/as fast as C. Shocked
Logged




Quote from: my dad
"welcome to the world of computers, where everything seems to be based on random number generators"



The Game V. 2.0
Chockosta
LV6 Super Member (Next: 500)
******
Offline Offline

Gender: Male
Last Login: Yesterday at 20:19:59
Date Registered: 03 June, 2011, 20:14:17
Location: France
Posts: 440


Topic starter
Total Post Ratings: +159

View Profile
« Reply #46 on: 24 October, 2011, 13:20:59 »
0

You sure can use my code...

Have fun ! Smiley
Logged

Chockosta (Loic Pujet) - Sorry for my poor English...
Look at my projects :
in C code : Periodic table, Space invaders, Fall, Snake, Minesweeper, nCraft (WIP)
in Lua : Snake, Space invaders, Bobby Carrot, Minesweeper, Mazes 3D, nSpaint, FreeCell, Tiny3D-Viewer, CubeField, Gravity Guy
flyingfisch
I'm 1337 now!
LV10 31337 u53r (Next: 2000)
**********
Offline Offline

Gender: Male
Last Login: Yesterday at 23:45:21
Date Registered: 26 August, 2011, 21:18:14
Location: OH, USA
Posts: 1497


Total Post Ratings: +74

View Profile WWW
« Reply #47 on: 24 October, 2011, 18:32:21 »
0

Thank you!
Logged




Quote from: my dad
"welcome to the world of computers, where everything seems to be based on random number generators"



The Game V. 2.0
Chockosta
LV6 Super Member (Next: 500)
******
Offline Offline

Gender: Male
Last Login: Yesterday at 20:19:59
Date Registered: 03 June, 2011, 20:14:17
Location: France
Posts: 440


Topic starter
Total Post Ratings: +159

View Profile
« Reply #48 on: 03 December, 2011, 16:12:05 »
+1

Hello !

I wrote a little 3D viewer with this engine.
You can draw :
- Cube
- Tetrahedron
- Pyramid
- Cone
- Torus
- Sphere
- Cylinder
- Hypercube (tesseract)

You also can draw 3D functions. (even if the OS already provides this)
You can choose the color, the zoom...

I just realised that I spent days to write this useless tool... Sad
I really should create a new game.


DOWNLOAD


* ScreenShot081.gif (9.89 KB, 321x240 - viewed 1640 times.)

* ScreenShot082.gif (6.83 KB, 319x241 - viewed 148 times.)

* ScreenShot083.gif (9.82 KB, 320x240 - viewed 654 times.)

* ScreenShot084.gif (10.05 KB, 321x240 - viewed 645 times.)
* Tiny3D-Viewer.zip (10.02 KB - downloaded 17 times.)
« Last Edit: 04 December, 2011, 15:30:56 by Chockosta » Logged

Chockosta (Loic Pujet) - Sorry for my poor English...
Look at my projects :
in C code : Periodic table, Space invaders, Fall, Snake, Minesweeper, nCraft (WIP)
in Lua : Snake, Space invaders, Bobby Carrot, Minesweeper, Mazes 3D, nSpaint, FreeCell, Tiny3D-Viewer, CubeField, Gravity Guy
Nick
LV9 Veteran (Next: 1337)
*********
Offline Offline

Gender: Male
Last Login: 20 May, 2013, 20:44:19
Date Registered: 05 June, 2011, 20:01:07
Location: 51° 12′ 34″ N, 3° 13′ 31″ E
Posts: 1178


Total Post Ratings: +158

View Profile WWW
« Reply #49 on: 03 December, 2011, 16:51:35 »
0

i really want to lear how to put this engine into a game, can you maybe give a tuorial/readme file, cause i don't really get it xs

but it is really amazing, nice work!
Logged

Chockosta
LV6 Super Member (Next: 500)
******
Offline Offline

Gender: Male
Last Login: Yesterday at 20:19:59
Date Registered: 03 June, 2011, 20:14:17
Location: France
Posts: 440


Topic starter
Total Post Ratings: +159

View Profile
« Reply #50 on: 03 December, 2011, 16:58:01 »
+2

Okay, I'm writing a tutorial.
I'll post it soon.

EDIT : Finished ! It is attached to my post. (English isn't my first language, so maybe there are mistakes)
And here is the latest vesion of the engine.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
--Lua Tiny3D - By Loic Pujet

function multiplyMatrix(matrix,vector)
 local x=matrix[1][1]*vector[1]+matrix[1][2]*vector[2]+matrix[1][3]*vector[3]
 local y=matrix[2][1]*vector[1]+matrix[2][2]*vector[2]+matrix[2][3]*vector[3]
 local z=matrix[3][1]*vector[1]+matrix[3][2]*vector[2]+matrix[3][3]*vector[3]
 return x,y,z
end

function rotate(vertices,angle,x,y,z)
 local sum=x+y+z
 x,y,z=x/sum,y/sum,z/sum
 local c,s=math.cos(angle),math.sin(angle)
 local matrix={{x*x+(1-x*x)*c,x*y*(1-c)-z*s,x*z*(1-c)+y*s},{x*y*(1-c)+z*s,y*y+(1-y*y)*c,y*z*(1-c)-x*s},{x*z*(1-c)-y*s,y*z*(1-c)+x*s,z*z+(1-z*z)*c}}
 for i,e in pairs(vertices) do
  vertices[i]={multiplyMatrix(matrix,e)}
 end
end

function translate(vertices,x,y,z)
 for i,e in pairs(vertices) do
  vertices[i]={e[1]+x,e[2]+y,e[3]+z}
 end
end

function scale(vertices,x,y,z)
 for i,e in pairs(vertices) do
  vertices[i]={e[1]*x,e[2]*y,e[3]*z}
 end
end

function width() return platform.window:width() end
function height() return platform.window:height() end

function reverseTable(tbl)
 local tbl2={}
 for i,e in ipairs(tbl) do
  tbl2[#tbl-i+1]=e
 end
 return tbl2
end

function replaceFaces(tbl1,tbl2,faces)
 local faces2,count={},1
 for i,e in pairs(tbl1) do
  for j,e2 in pairs(tbl2) do
   if e2 then
    if e==e2 then
     faces2[count]=faces[j]
     count=count+1
     tbl2[j]=nil
    end
   end
  end
 end
 return reverseTable(faces2)
end

function sortFaces(vertices,faces)
 local faces2,distTbl,facesTbl={},{},{}
 local middle={}
 local dist,xsum,ysum,zsum=0,0,0,0
 for i,e in pairs(faces) do
  xsum,ysum,zsum=0,0,0,0
  for j,e2 in pairs(e) do
   xsum,ysum,zsum=xsum+vertices[e2][1],ysum+vertices[e2][2],zsum+vertices[e2][3]
  end
  middle={xsum/#e,ysum/#e+5,zsum/#e}
   dist=middle[1]*middle[1]+middle[2]*middle[2]+middle[3]*middle[3]
  distTbl[i]=dist
  facesTbl[i]=dist
 end
 table.sort(distTbl)
 return replaceFaces(distTbl,facesTbl,faces)
end

function chooseColor(gc,vertices,face,color)
 if #face<3 then
  gc:setColorRGB(color[1],color[2],color[3])
 else
  local a,b,c=vertices[face[1]][1]-vertices[face[2]][1],vertices[face[1]][2]-vertices[face[2]][2],vertices[face[1]][3]-vertices[face[2]][3]
  local d,e,f=vertices[face[1]][1]-vertices[face[3]][1],vertices[face[1]][2]-vertices[face[3]][2],vertices[face[1]][3]-vertices[face[3]][3]
  local normale={math.abs(b*f-c*e),math.abs(c*d-a*f),math.abs(a*e-b*d)}
  local angle=math.atan(math.sqrt(normale[1]*normale[1]+normale[3]*normale[3])/normale[2])
  local R,G,B=color[1]+angle*-60+50,color[2]+angle*-60+50,color[3]+angle*-60+50
  R,G,B=R>255 and 255 or R,G>255 and 255 or G,B>255 and 255 or B
  R,G,B=R<0 and 0 or R,G<0 and 0 or G,B<0 and 0 or B
  gc:setColorRGB(R,G,B)
 end
end

function renderFaces(gc,vertices,faces,pos,mode,color)
 local polygon,size,faces2={},0,{}
 if mode==4 or mode==5 or mode==6 then
  faces2=sortFaces(vertices,faces)
 else
  faces2=faces
 end
 for i,e in pairs(faces2) do
  polygon,size={},0
  drawPoly=true
  for j,f in pairs(faces2[i]) do
   if not pos[f] then
    drawPoly=false
   else
    polygon[j*2-1]=pos[f][1]
    polygon[j*2]=pos[f][2]
    size=size+2
   end
  end
  if drawPoly then
   polygon[size+1]=pos[faces2[i][1]][1]
   polygon[size+2]=pos[faces2[i][1]][2]
   if mode==4 then
    gc:setColorRGB(color[1],color[2],color[3])
    gc:fillPolygon(polygon)
   elseif mode==5 or mode==6 then
    chooseColor(gc,vertices,e,color)
    gc:fillPolygon(polygon)
   end
   if mode==2 or mode==3 or mode==4 or mode==5 then
    gc:setColorRGB(0,0,0)
    gc:setPen("thin","smooth")
    gc:drawPolyLine(polygon)
   end
  end
 end
end

function renderVertices(gc,pos)
 gc:setColorRGB(0,0,0)
 for i,e in pairs(pos) do
  if e then
   gc:fillRect(e[1]-1,e[2]-1,3,3)
  end
 end
end

function render(gc,vertices,faces,mode,color,offset)
 local yDist,pos=0,{}
 for i,e in pairs(vertices) do
  if e[2]>-offset then
   yDist=offset/(e[2]+offset)
   pos[i]={e[1]*yDist*25+width()/2,height()/2-e[3]*yDist*25}
  else
   pos[i]=false
  end
 end
 if mode==1 or mode==2 then
  renderVertices(gc,pos)
 end
 if #faces>0 and (mode==2 or mode==3 or mode==4 or mode==5 or mode==6) then
  renderFaces(gc,vertices,faces,pos,mode,color)
 end
end

* Tiny3D tutorial.pdf (53.67 KB - downloaded 47 times.)
« Last Edit: 03 December, 2011, 18:43:37 by Chockosta » Logged

Chockosta (Loic Pujet) - Sorry for my poor English...
Look at my projects :
in C code : Periodic table, Space invaders, Fall, Snake, Minesweeper, nCraft (WIP)
in Lua : Snake, Space invaders, Bobby Carrot, Minesweeper, Mazes 3D, nSpaint, FreeCell, Tiny3D-Viewer, CubeField, Gravity Guy
Nick
LV9 Veteran (Next: 1337)
*********
Offline Offline

Gender: Male
Last Login: 20 May, 2013, 20:44:19
Date Registered: 05 June, 2011, 20:01:07
Location: 51° 12′ 34″ N, 3° 13′ 31″ E
Posts: 1178


Total Post Ratings: +158

View Profile WWW
« Reply #51 on: 03 December, 2011, 20:46:56 »
0

thanks, i'll certainly give it a try, as soon i finished my other projects Smiley
the tutorial looks great, simple, but straight forward! that's how tutorials have to be, good job!

so if i understand everything good, i just have to paste your engine-code below my code?
« Last Edit: 03 December, 2011, 20:47:49 by Nick » Logged

Chockosta
LV6 Super Member (Next: 500)
******
Offline Offline

Gender: Male
Last Login: Yesterday at 20:19:59
Date Registered: 03 June, 2011, 20:14:17
Location: France
Posts: 440


Topic starter
Total Post Ratings: +159

View Profile
« Reply #52 on: 03 December, 2011, 23:49:55 »
0

Yes Smiley

Nice to see that someone use it !
Logged

Chockosta (Loic Pujet) - Sorry for my poor English...
Look at my projects :
in C code : Periodic table, Space invaders, Fall, Snake, Minesweeper, nCraft (WIP)
in Lua : Snake, Space invaders, Bobby Carrot, Minesweeper, Mazes 3D, nSpaint, FreeCell, Tiny3D-Viewer, CubeField, Gravity Guy
renatose
LV5 Advanced (Next: 300)
*****
Offline Offline

Gender: Male
Last Login: Yesterday at 17:06:15
Date Registered: 17 March, 2011, 21:35:59
Location: Portugal
Posts: 201


Total Post Ratings: +3

View Profile
« Reply #53 on: 04 December, 2011, 02:21:36 »
0

I just realised that I spent days to write this useless tool... Sad

This is not useless, this can be made more powerful that the OS 3D graphing. Can you make it accept any functions? i.e. to insert x^2+y^2+z^2=2^2 which is an origin centered radius 2 sphere in the OS 3d graphing I've got to solve it in order to z before writing that which results in 2 equations: z(x,y)=sqrt(2^2-x^2-y^2) and z(x,y)=sqrt(2^2-x^2-y^2)
it would be nice if your Tiny3D accepted any function to draw.
Logged

DJ Omnimaga
Retired Omnimaga founder (Site issues must be PM'ed to Netham45, Eeems, Shmibs, Deep Thought and AngelFish, not me.)
Editor
LV15 Omnimagician (Next: --)
*
Offline Offline

Gender: Male
Last Login: Today at 07:29:18
Date Registered: 25 August, 2008, 07:00:21
Location: Québec (Canada)
Posts: 50226


Total Post Ratings: +2615

View Profile WWW
« Reply #54 on: 04 December, 2011, 06:41:57 »
0

This looks nice. You should post a tns demo so we can see how fast it is. Cheesy I wonder if it could be fast enough for simple games like Star fox? I'm glad you're still working on this by the way. Cheesy

EDIT: Nvm I didn't see the zip file above the screenshots. Gonna try it soon.
« Last Edit: 04 December, 2011, 07:27:20 by DJ_O » Logged

Retired 83+ coder, Omnimaga/TIMGUL founder. Now doing power metal music (formerly did electronica)

Follow me on Bandcamp|Facebook|Reverbnation|Youtube|Twitter|Myspace
Chockosta
LV6 Super Member (Next: 500)
******
Offline Offline

Gender: Male
Last Login: Yesterday at 20:19:59
Date Registered: 03 June, 2011, 20:14:17
Location: France
Posts: 440


Topic starter
Total Post Ratings: +159

View Profile
« Reply #55 on: 04 December, 2011, 15:09:57 »
0

I just realised that I spent days to write this useless tool... Sad

This is not useless, this can be made more powerful that the OS 3D graphing. Can you make it accept any functions? i.e. to insert x^2+y^2+z^2=2^2 which is an origin centered radius 2 sphere in the OS 3d graphing I've got to solve it in order to z before writing that which results in 2 equations: z(x,y)=sqrt(2^2-x^2-y^2) and z(x,y)=sqrt(2^2-x^2-y^2)
it would be nice if your Tiny3D accepted any function to draw.

Actually my function drawer is really basic. It only draw one function, which has to be like z(x,y)=...
I could write another one to allow that.

This looks nice. You should post a tns demo so we can see how fast it is. Cheesy I wonder if it could be fast enough for simple games like Star fox? I'm glad you're still working on this by the way. Cheesy

EDIT: Nvm I didn't see the zip file above the screenshots. Gonna try it soon.
I'm not sure that it's possible, but I'll try. The main problem is the key input...
Logged

Chockosta (Loic Pujet) - Sorry for my poor English...
Look at my projects :
in C code : Periodic table, Space invaders, Fall, Snake, Minesweeper, nCraft (WIP)
in Lua : Snake, Space invaders, Bobby Carrot, Minesweeper, Mazes 3D, nSpaint, FreeCell, Tiny3D-Viewer, CubeField, Gravity Guy
Nick
LV9 Veteran (Next: 1337)
*********
Offline Offline

Gender: Male
Last Login: 20 May, 2013, 20:44:19
Date Registered: 05 June, 2011, 20:01:07
Location: 51° 12′ 34″ N, 3° 13′ 31″ E
Posts: 1178


Total Post Ratings: +158

View Profile WWW
« Reply #56 on: 04 December, 2011, 15:14:48 »
0

i hate that key input with lua, soooo slow.. and it doesn't even support a keep-op-pressing function (only arrows) that's so stupid
« Last Edit: 04 December, 2011, 15:14:58 by Nick » Logged

Chockosta
LV6 Super Member (Next: 500)
******
Offline Offline

Gender: Male
Last Login: Yesterday at 20:19:59
Date Registered: 03 June, 2011, 20:14:17
Location: France
Posts: 440


Topic starter
Total Post Ratings: +159

View Profile
« Reply #57 on: 04 December, 2011, 15:29:08 »
0

Actually, the space key and delete key also repeat, but I agree with you.



BTW, a very small update, with a little bugfix.
With very high values for the offset, the faces did not display right. It is now fixed.


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
--Lua Tiny3D - By Loic Pujet

function multiplyMatrix(matrix,vector)
 local x=matrix[1][1]*vector[1]+matrix[1][2]*vector[2]+matrix[1][3]*vector[3]
 local y=matrix[2][1]*vector[1]+matrix[2][2]*vector[2]+matrix[2][3]*vector[3]
 local z=matrix[3][1]*vector[1]+matrix[3][2]*vector[2]+matrix[3][3]*vector[3]
 return x,y,z
end

function width() return platform.window:width() end
function height() return platform.window:height() end

function reverseTable(tbl)
 local tbl2={}
 for i,e in ipairs(tbl) do
  tbl2[#tbl-i+1]=e
 end
 return tbl2
end

function replaceFaces(tbl1,tbl2,faces)
 local faces2,count={},1
 for i,e in pairs(tbl1) do
  for j,e2 in pairs(tbl2) do
   if e2 then
    if e==e2 then
     faces2[count]=faces[j]
     count=count+1
     tbl2[j]=nil
    end
   end
  end
 end
 return reverseTable(faces2)
end

function sortFaces(vertices,faces,offset)
 local faces2,distTbl,facesTbl={},{},{}
 local middle={}
 local dist,xsum,ysum,zsum=0,0,0,0
 for i,e in pairs(faces) do
  xsum,ysum,zsum=0,0,0,0
  for j,e2 in pairs(e) do
   xsum,ysum,zsum=xsum+vertices[e2][1],ysum+vertices[e2][2],zsum+vertices[e2][3]
  end
  middle={xsum/#e,ysum/#e+offset,zsum/#e}
   dist=middle[1]*middle[1]+middle[2]*middle[2]+middle[3]*middle[3]
  distTbl[i]=dist
  facesTbl[i]=dist
 end
 table.sort(distTbl)
 return replaceFaces(distTbl,facesTbl,faces)
end

function chooseColor(gc,vertices,face,color)
 if #face<3 then
  gc:setColorRGB(color[1],color[2],color[3])
 else
  local a,b,c=vertices[face[1]][1]-vertices[face[2]][1],vertices[face[1]][2]-vertices[face[2]][2],vertices[face[1]][3]-vertices[face[2]][3]
  local d,e,f=vertices[face[1]][1]-vertices[face[3]][1],vertices[face[1]][2]-vertices[face[3]][2],vertices[face[1]][3]-vertices[face[3]][3]
  local normale={math.abs(b*f-c*e),math.abs(c*d-a*f),math.abs(a*e-b*d)}
  local angle=math.atan(math.sqrt(normale[1]*normale[1]+normale[3]*normale[3])/normale[2])
  local R,G,B=color[1]+angle*-60+50,color[2]+angle*-60+50,color[3]+angle*-60+50
  R,G,B=R>255 and 255 or R,G>255 and 255 or G,B>255 and 255 or B
  R,G,B=R<0 and 0 or R,G<0 and 0 or G,B<0 and 0 or B
  gc:setColorRGB(R,G,B)
 end
end

function renderFaces(gc,vertices,faces,pos,mode,color,offset)
 local polygon,size,faces2={},0,{}
 if mode==4 or mode==5 or mode==6 then
  faces2=sortFaces(vertices,faces,offset)
 else
  faces2=faces
 end
 for i,e in pairs(faces2) do
  polygon,size={},0
  drawPoly=true
  for j,f in pairs(faces2[i]) do
   if not pos[f] then
    drawPoly=false
   else
    polygon[j*2-1]=pos[f][1]
    polygon[j*2]=pos[f][2]
    size=size+2
   end
  end
  if drawPoly then
   polygon[size+1]=pos[faces2[i][1]][1]
   polygon[size+2]=pos[faces2[i][1]][2]
   if mode==4 then
    gc:setColorRGB(color[1],color[2],color[3])
    gc:fillPolygon(polygon)
   elseif mode==5 or mode==6 then
    chooseColor(gc,vertices,e,color)
    gc:fillPolygon(polygon)
   end
   if mode==2 or mode==3 or mode==4 or mode==5 then
    gc:setColorRGB(0,0,0)
    gc:setPen("thin","smooth")
    gc:drawPolyLine(polygon)
   end
  end
 end
end

function renderVertices(gc,pos)
 gc:setColorRGB(0,0,0)
 for i,e in pairs(pos) do
  if e then
   gc:fillRect(e[1]-1,e[2]-1,3,3)
  end
 end
end

----------------------------------------------------------------------------

function rotate(vertices,angle,x,y,z)
 local sum=x+y+z
 x,y,z=x/sum,y/sum,z/sum
 local c,s=math.cos(angle),math.sin(angle)
 local matrix={{x*x+(1-x*x)*c,x*y*(1-c)-z*s,x*z*(1-c)+y*s},{x*y*(1-c)+z*s,y*y+(1-y*y)*c,y*z*(1-c)-x*s},{x*z*(1-c)-y*s,y*z*(1-c)+x*s,z*z+(1-z*z)*c}}
 for i,e in pairs(vertices) do
  vertices[i]={multiplyMatrix(matrix,e)}
 end
end

function translate(vertices,x,y,z)
 for i,e in pairs(vertices) do
  vertices[i]={e[1]+x,e[2]+y,e[3]+z}
 end
end

function scale(vertices,x,y,z)
 for i,e in pairs(vertices) do
  vertices[i]={e[1]*x,e[2]*y,e[3]*z}
 end
end

function render(gc,vertices,faces,mode,color,offset)
 local yDist,pos=0,{}
 for i,e in pairs(vertices) do
  if e[2]>-offset then
   yDist=offset/(e[2]+offset)
   pos[i]={e[1]*yDist*25+width()/2,height()/2-e[3]*yDist*25}
  else
   pos[i]=false
  end
 end
 if mode==1 or mode==2 then
  renderVertices(gc,pos)
 end
 if #faces>0 and (mode==2 or mode==3 or mode==4 or mode==5 or mode==6) then
  renderFaces(gc,vertices,faces,pos,mode,color,offset)
 end
end

----------------------------------------------------------------------------
Logged

Chockosta (Loic Pujet) - Sorry for my poor English...
Look at my projects :
in C code : Periodic table, Space invaders, Fall, Snake, Minesweeper, nCraft (WIP)
in Lua : Snake, Space invaders, Bobby Carrot, Minesweeper, Mazes 3D, nSpaint, FreeCell, Tiny3D-Viewer, CubeField, Gravity Guy
Jim Bauwens
Lua! Nspire! Linux!
Editor
LV10 31337 u53r (Next: 2000)
*
Offline Offline

Gender: Male
Last Login: Yesterday at 22:51:04
Date Registered: 28 February, 2011, 22:32:12
Location: Belgium
Posts: 1733


Total Post Ratings: +180

View Profile WWW
« Reply #58 on: 04 December, 2011, 17:29:01 »
0

And the tab key repeats Smiley
Logged

DJ Omnimaga
Retired Omnimaga founder (Site issues must be PM'ed to Netham45, Eeems, Shmibs, Deep Thought and AngelFish, not me.)
Editor
LV15 Omnimagician (Next: --)
*
Offline Offline

Gender: Male
Last Login: Today at 07:29:18
Date Registered: 25 August, 2008, 07:00:21
Location: Québec (Canada)
Posts: 50226


Total Post Ratings: +2615

View Profile WWW
« Reply #59 on: 26 December, 2011, 05:30:25 »
0

Another issue is it seems multi-keypress is lacking, but I could be wrong. I just haven't seen any game using them in Lua.
Logged

Retired 83+ coder, Omnimaga/TIMGUL founder. Now doing power metal music (formerly did electronica)

Follow me on Bandcamp|Facebook|Reverbnation|Youtube|Twitter|Myspace
Pages: 1 2 3 [4]   Go Up
  Print  
 
Jump to:  

Powered by EzPortal
Powered by MySQL Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Powered by PHP
Page created in 0.752 seconds with 30 queries.
Skin by DJ Omnimaga edited from SMF default theme with the help of tr1p1ea.
All programs, games and songs avaliable on this website are property of their respective owners.
Best viewed in Opera, Firefox, Chrome and Safari with a resolution of 1024x768 or above.