|
Post by johnwedd on Dec 21, 2009 5:49:05 GMT -5
Wow, B4GL has come a long way, i am starting to miss it.
|
|
|
Post by shadow008 on Dec 21, 2009 8:07:03 GMT -5
Cool but the Demo lags on my new computer nicky, i mean seriously it brings a quad core 4 gigs of ram and a gt 220 to like 10 fps -darkjester runs perfectly fine for me (my computer < your computer)
|
|
|
Post by Adam on Jan 13, 2010 21:33:06 GMT -5
got bored yesterday and made the unit circle in gl. still being bored, i made it into a Ferris Wheel
dim x,y,z
glpointsize(7) gllinewidth(5) gltranslatef(0,0,-2.5)
Sub drawCircle() glcolor3f(.5,.5,.5) glbegin(GL_LINES) for x = 0 to 360 step 15 if (not x % 2 = 1) or abs(cosd(x)) = abs(sind(x)) then glColor3f(cosd(x)/1.5,sind(x)/1.5,(-sind(x)-cosd(x))/1.5) glvertex2f(0,0) glvertex2f(cosd(x),sind(x)) endif next glend() GLBegin(GL_Line_Loop) for x = 0 to 360 step 5 glColor3f(cosd(x)/1.5,sind(x)/1.5,(-sind(x)-cosd(x))/1.5) glvertex2f(cosd(x),sind(x)) next glend() End sub
Sub drawPoints() glcolor3f(0,1,0) glBegin(GL_Points) for x = 0 to 360 step 15 if (not x % 2 = 1) or abs(cosd(x)) = abs(sind(x)) then glColor3f(-cosd(x)/1.5,-sind(x)/1.5,(sind(x)+cosd(x))/1.5) glvertex2f(cosd(x),sind(x)) endif next glEnd() end sub
glrotatef(45,1,0,0) dim rot#
do glclear(GL_COLOR_BUFFER_BIT or GL_DEPTH_BUFFER_BIT) glrotatef(.25,0,1,0) glcolor3f(.5,.5,.5) glBegin(GL_Line_lOOP) glvertex3f(.05,0,-.30) glvertex3f(-.05,0,-.30) glvertex3f(-1,-1.25,-.30) glvertex3f(-1,-1.25,.05) glvertex3f(-1,-1.25,-.30)
glvertex3f(1,-1.25,-.30) glvertex3f(1,-1.25,.05)
glvertex3f(.05,0,.05) glvertex3f(-.05,0,.05) glvertex3f(-1,-1.25,.05) glvertex3f( 1,-1.25,.05) glvertex3f(1,-1.25,-.30) glvertex3f(-1,-1.25,-.3) glvertex3f(1,-1.25,-.3) glEnd() glbegin(GL_LINES) glvertex3f(0,0,.05) glvertex3f(0,0,-.3) glend()
glpushmatrix() glrotatef(rot#,0,0,1) glcolor3f(.5,.5,.5) glBegin(GL_Lines) for x = 0 to 360 step 15 if (not x % 2 = 1) or abs(cosd(x)) = abs(sind(x)) then glColor3f(-cosd(x)/1.5,-sind(x)/1.5,(sind(x)+cosd(x))/1.5) glvertex3f(cosd(x),sind(x),0) glvertex3f(cosd(x),sind(x),-.25) endif next glEnd() drawcircle() drawpoints() glpushmatrix() gltranslatef(0,0,-.25) drawcircle() drawpoints() glpopmatrix() glpopmatrix() swapbuffers() sleep(1000/60) rot# = rot# + .5 loop
|
|
|
Post by Adam on Feb 1, 2010 19:39:34 GMT -5
Wrote a program to do my trig homework for me, figured I might as well post it in the hopes it helps someone else
Y = A sin(B x + C ) + D
'Y = Asin(Bx + C) 'for cosine set C to PI*.5
Const PI As Single = 3.1415
Dim I As Single, Offset as single
GLLineWidth(3) GLPointSize(3) glhint(gl_point_smooth_hint, gl_nicest) TextMode(TEXT_OVERLAID)
Sub DrawLines(A As single,B As Single, D As Single) GLColor3F(0,0,0) GLBegin(GL_LINES) 'Mark X-Axis For I = 1 To 4 'Positive GLVertex3f(2*PI/B*(I/4),A/15,-(abs(A)*2+10)) GLVertex3f(2*PI/B*(I/4) ,-A/15,-(abs(A)*2+10)) 'Negative GLVertex3f(-2*PI/B*(I/4),A/15,-(abs(A)*2+10)) GLVertex3f(-2*PI/B*(I/4) ,-A/15,-(abs(A)*2+10)) Next GLVertex3f(-A/15,D+A,-(abs(A)*2+10)) GLVertex3f( A/15,D+A,-(abs(A)*2+10))
GLVertex3f(-A/15,D-A,-(abs(A)*2+10)) GLVertex3f( A/15,D-A,-(abs(A)*2+10))
GLEnd() End Sub
Sub GraphWave(Mode,A As Single, B As Single, C As Single,D As Single) GLBegin(Mode) For I = -(abs(A)*2+10)*.8 to (abs(A)*2+10)*.8 Step .02 GLVertex3f(I,D+A*Sin(I*B+C),-(abs(A)*2+10)) Next GLEnd() DrawLines(A,B,D) End Sub
Sub MarkGraph() Color(0,0,0) Locate 10,27:Print "-2PI"
Locate 16,27:Print "-3PI" Locate 17,28:Print "---" Locate 18,29:Print "2"
Locate 23,27:Print "-PI"
Locate 28,27:Print "- PI" Locate 29,28:Print "---" Locate 30,29:Print "2"
Locate 35,27:Print "0"
Locate 41,27:Print "PI" Locate 41,28:Print "--" Locate 42,29:Print "2"
Locate 47,27:Print "PI"
Locate 52,27:Print "3PI" Locate 52,28:Print "---" Locate 53,29:Print "2"
Locate 58,27:Print "2PI"
Locate 36,30:Print "-1" Locate 36,22:Print " 1"
Locate 36,3 :Print "Y" Locate textcols()-1,27:Print "X" End Sub
GLClearColor(.6,.6,.6,0) Color(0,0,0) ResizeText(WindowWidth()/22,windowheight()/22)
Do GLClear(GL_COLOR_BUFFER_BIT or GL_DEPTH_BUFFER_BIT) GLColor3f(0,0,0) 'X-Axis GLBegin(GL_LINES) GLVertex3f(-55,0,-(abs(10)*2+10)) GLVertex3f(55,0,-(abs(10)*2+10))
'Y-Axis GLVertex3f(0,-10-(10/2),-(abs(10)*2+10)) GLVertex3f(0,10+(10/2),-(abs(10)*2+10)) GLEnd()
GLColor3f(0,1,0) GraphWave(GL_LINE_STRIP,1,1,0,0) GLColor3f(0,0,1) GraphWave(GL_LINE_STRIP,1,1,PI*.5,0)
Cls Color(0,0,255) Printr "Y=sinx" Color(0,255,0) Printr "Y=cosx" MarkGraph() DrawText() SwapBuffers() Loop
|
|
|
Post by DJLinux on Feb 2, 2010 13:53:17 GMT -5
sorry darkjester i deleted your post here i pressed edit this post not quote the post now i'm up to date too. i get a GeForce GT 240 (cuda, physics, Open CL ten tausend of threads ...) now i'm waiting for the postman
|
|
|
Post by Adam on Aug 1, 2010 7:02:20 GMT -5
finally got around to making a gui library (makes a nice addition to the window library) so, tell me what you think gui betanote: try changing the clear color, the gui is affected by whats behind it
|
|