|
Post by Scott2004 on Jan 20, 2004 9:15:41 GMT -5
I have been programming in QB45 for some time now I would like to convert some of my programs over to Basic4GL but it's new to me and I need some help some help. I have created many things and I am willing to give some source over to people who are intrested in recreateing some for Basic4GL. I loved to see some revamped. I also have alot of new questions being it that it is new to me so please someone help me and I am willing to share thanks.
1.) How do I create large arrays? 2.) How do I plot pixels? 3.) How do I read in a data file?
I have many new questions of how to do things in Basic4GL. They seem like stupiid questions since they are easy to do when your working with a language you already know but that's enough to start with.
Oh, and back to free QB45 code for anyone intrested in doing some coverting. I have ...
Puzzle Program, Fire effects, Fractal and non-fractal mountains, small fractals like tree, koch, Bumpmapping, Burnt papper, Starfields, filtering, clouds, beginning of sliding puzzle, Anti-Aliasing, Blurred, Diamond frac, plasma frac, real-time plasma effects, encryption, cypher decodeing, static, cosmic gases, lots of small programs all free from me for the takeing and recreation in Basic4GL by the way the mountains have multi-texturemapping, heightmapping, shadeing ect...
So, E-mail me or post a reply I would love to see these and more in this powerful new language. It definently looks like a step up in Basic4GL !!!
bye! for now Scott2004
|
|
|
Post by cykotic on Jan 20, 2004 14:08:31 GMT -5
hey.. I'd like to take a look at your QB45 sources and I'll see what I can do.. get back to me
|
|
|
Post by Tom Mulgrew on Jan 20, 2004 19:48:45 GMT -5
Hey Scott. Good to see you made it into the forums. Sorry I didn't get time to reply to your email before. You can "dim" 1D and 2D (or 3D, 4D, e.t.c) arrays of reasonable sizes (up to about 256 meg). Dim bigArray(1000)(1000) Would allocate 1 million integers for example. Dim heightField#(1000)(1000) Would allocate 1 million floating point numbers. Drawing is done through OpenGL commands. So you need to learn a bit of OpenGL to write anything except text based programs. I recommend the NeHe OpenGL tutorials (http://nehe.gamedev.net). There are Basic4GL versions of some of the example programs in the "programs" directory, named nehe2.gb, 3, 4, e.t.c. Here's a simple example of 2D drawing in OpenGL const width = 1000, height = 800
' Set 2D mode glMatrixMode (GL_PROJECTION) glLoadIdentity () glOrtho (0, width, 0, height, -1, 1) glMatrixMode (GL_MODELVIEW) glDisable (GL_DEPTH_TEST)
' Clear screen glClear (GL_COLOR_BUFFER_BIT)
' Plot some pixels glBegin (GL_POINTS) glColor3f (1, 0, 0): glVertex2f (400, 300) glColor3f (0, 1, 0): glVertex2f (600, 300) glColor3f (0, 0, 1): glVertex2f (600, 500) glColor3f (1, 1, 1): glVertex2f (400, 500) glEnd ()
' Draw some lines glBegin (GL_LINES) glColor3f (1, 1, 0) glVertex2f (0, 0) glVertex2f (width, height) glColor3f (0, 1, 1) glVertex2f (0, height) glVertex2f (width, 0) glEnd ()
' Display output SwapBuffers ()
Have a look at the "File I/O section" in the "Programmer's guide" help file. An example of loading from a file: dim file file = OpenFileRead ("files/world.txt") while FileError () = "" printr ReadLine (file) wend CloseFile (file)
It should be just a matter of picking the correct ReadSomething function to match the data in the file (ReadByte, ReadWord, ReadFloat e.t.c) The md2 viewer example programs demonstrate standard file I/O in Basic4GL. ------------ I can't guarantee that everything will port well to Basic4GL. It's still a new and developing language. Things like plasma and fire effects especially might be difficult. If you come across any important features that appear to be blantantly missing, feel free to point them out. I may be able to add them to the next release. -Tom
|
|