Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - Kitty Hello

#10606
Hi,

Ich hab' einen Export-filter, der ausgewählte oder alle Objekte in das GLBasic .ddd Dateiformat konvertiert. Das Plugin kann hier heruntergeladen werden:
http://www.glbasic.com/files/ac3d-ddd-plugin.zip

Weitere Informationen über AC3D auf www.AC3D.org.

AC3D ist der empfehlenswerteste 3D Modeller für GLBasic Spiele.
#10607
Hi,

I've written an export plugin that exports all or all selected objects to the GLBasic .ddd file format. You can download the source code and the windows plugin from here:
http://www.glbasic.com/files/ac3d-ddd-plugin.zip

More information about AC3D on www.AC3D.org.

AC3D is the best reccomended 3D modeller for GLBasic games.
#10608
GLBasic - en / mouse cursor
2004-Apr-05
Either draw a sprite or print somethins to the mouse location:

Code (glbasic) Select
LOADSPRITE "MyPointer.bmp", 12
start:
MOUSESTATE mx, my, b1, b2
SPRITE 12, mx, my
SHOWSCREEN
GOTO start

or:

Code (glbasic) Select
start:
MOUSESTATE mx, my, b1, b2
PRINT "X", mx, my
SHOWSCREEN
GOTO start

Have fun,
Gernot
#10609
Na, wie wär's mit schönen 3D-Bäumen mit Blättern usw...? Hier ist ein einfaches Grundgerüst dafür:

Code (glbasic) Select
// --------------------------------- //
// Project:
// Start: Monday, March 29, 2004
// IDE Version: 1.40327


// rule = “l [ + l ] l [ - l] l” [Jürgens Hartmut, Peitgen Heinz-Otto, Saupe Dietmar:
//                                Fraktale - eine neue Sprache für komplexe Strukturen,
//                                Spektrum der Wissenschaft (9/1989), p.62.] with
// l = line
// + = +28.58 degrees
// - = -28.58 degrees
// [ = start of a branch
// ] = end of a branch


    NewBranch(200,200,0, 0, -90, 0, 10)
SHOWSCREEN
MOUSEWAIT

// ------------------------------------------------------------- //
// -=#  NEWBRANCH  #=-
// ------------------------------------------------------------- //
FUNCTION NewBranch: x, y, z, phi, psi, depth, maxdepth

LOCAL ex, ey, ez, px, py, pz, lngth, ln_bottom, dphi, dpsi
LOCAL n, nbranches, col
lngth = 100/(1+depth)
ln_bottom = lngth*COS(psi)
nbranches = 2

ex = x + COS(phi)*ln_bottom
ey = y + SIN(psi)*lngth
ez = z + SIN(phi)*ln_bottom

IF (depth FOR n=1 TO nbranches
pos = n/(nbranches+1)
px = x+(ex-x)*pos
py = y+(ey-y)*pos
pz = z+(ez-z)*pos

dphi = phi + (RND(2)-1)*28.58
dpsi = psi + (RND(2)-1)*28.58
NewBranch(px, py, pz, dphi, dpsi, depth+1, maxdepth)
NEXT
ENDIF

col = RGB(200 - 200*(depth/maxdepth), 64+128*(depth/maxdepth), 0)
// Front
DRAWLINE x, y, ex, ey, col
// Left
DRAWLINE z+120, y, ez+120, ey, col
// Top
DRAWLINE x, z+320, ex, ez+320, col
ENDFUNCTION


Und ein Bild:
#10610
Code Snippets / Factal Trees
2004-Mar-29
Well, how about drawing some nice 3D Trees with leaves and so on? Here's the basic framework needed:

Code (glbasic) Select
// --------------------------------- //
// Project:
// Start: Monday, March 29, 2004
// IDE Version: 1.40327


// rule = “l [ + l ] l [ - l] l” [Jürgens Hartmut, Peitgen Heinz-Otto, Saupe Dietmar:
//                                Fraktale - eine neue Sprache für komplexe Strukturen,
//                                Spektrum der Wissenschaft (9/1989), p.62.] with
// l = line
// + = +28.58 degrees
// - = -28.58 degrees
// [ = start of a branch
// ] = end of a branch


    NewBranch(200,200,0, 0, -90, 0, 10)
SHOWSCREEN
MOUSEWAIT

// ------------------------------------------------------------- //
// -=#  NEWBRANCH  #=-
// ------------------------------------------------------------- //
FUNCTION NewBranch: x, y, z, phi, psi, depth, maxdepth

LOCAL ex, ey, ez, px, py, pz, lngth, ln_bottom, dphi, dpsi
LOCAL n, nbranches, col
lngth = 100/(1+depth)
ln_bottom = lngth*COS(psi)
nbranches = 2

ex = x + COS(phi)*ln_bottom
ey = y + SIN(psi)*lngth
ez = z + SIN(phi)*ln_bottom

IF (depth FOR n=1 TO nbranches
pos = n/(nbranches+1)
px = x+(ex-x)*pos
py = y+(ey-y)*pos
pz = z+(ez-z)*pos

dphi = phi + (RND(2)-1)*28.58
dpsi = psi + (RND(2)-1)*28.58
NewBranch(px, py, pz, dphi, dpsi, depth+1, maxdepth)
NEXT
ENDIF

col = RGB(200 - 200*(depth/maxdepth), 64+128*(depth/maxdepth), 0)
// Front
DRAWLINE x, y, ex, ey, col
// Left
DRAWLINE z+120, y, ez+120, ey, col
// Top
DRAWLINE x, z+320, ex, ez+320, col
ENDFUNCTION


And an image:
#10611
Hallo,

Die Grafikkartentreiber müssen OpenGL unterstützen. Man lädt einfach beim Hersteller den aktuellsten Treiber herunter. Auf keinen Fall den von Microsoft mitgelieferten verwenden, da der spätestens ab WindowsXP nur Software-Rendering unterstützt (1-2 FPS maximal).
Welche Grafikkarte man hat ewrfährt man, indem man Systemsteuerung/Anzeige öffnet und dann den Tab:Einstellungen, Knopf: Erweitert, wieder Tab:Grafikkarte öffnet. Grundsätzlich bekommt man diese Treiber auch für Windows NT4.0, was bei DirectX ein Problem darstellt.

Einen Vergleich mit anderen Basics möchte ich nicht geben, das muss jeder selbst ausprobieren. Die Geschwindigkeit von GLBasic ist jedoch eine seiner Stärken.

Fenster und Buttons in Windows wird es nicht geben. Es bleibt ein Game-BASIC. Wir arbeiten jedoch an solchen Funktionen innerhalb von GLBasic mit den DRAWLINE und FILLRECT Befehlen.

DLL's wären einfach zu implementieren, jedoch kann man dann das Spiel nicht so einfach nach Linux konvertieren. Und darum kommt es wohl nicht. Alle Befehle funktionieren unter allen Plattformen. Derzeit Win32 und Linux.
#10612
Ein, wie ich finde, sehr interessanter Wettbewerb, bei dem man auch mit der kostenlosen Demo-Version von GLBasic  zu den Gewinnern gehören kann.

Hier geht's zu den Details

Viel Erfolg
#10613
GLBasic - de / MipMapping
2004-Mar-23
Holt euch die Internet-Updates regelmäßig. Diesmal (V1.40323) gibt's MipMapping:
Code (glbasic) Select
X_MIPMAPPING 1 // an
X_DRAWOBJ 1,0

Viel Spaß,
Gernot
#10614
Announcements / MipMapping
2004-Mar-23
Get the internet updates frequently. Featuring mipmapping this time (V1.40323)
Code (glbasic) Select
X_MIPMAPPING 1 // on
X_DRAWOBJ 1,0
Have fun,
Gernot
#10615
GLBasic - en / Linux IDE
2004-Mar-17
Well, you can run the IDE with WINE, but that's not intended. Also, there's a Compiler/Make Linux-Script button and a Install_linux script. Basically you should write your game on Win32, then send the source code in and get a (tested) linux binary back.
I will put up a compilation service soon, that will allow you to do this in the IDE on Win32 and receive the bin wihtin an hour or so...

Sorry for inconveniences. Porint the IDE to Linux seems too much work for me.
#10616
OK, ganz langsam.
Die Schuhschachteln, das sind komprimierte, verschlüsselte Ordner. Wie ein zip-Atchiv etwa. Die kann GLBasic dann mit dem Befeehl SETSHOEBOX verwenden, um Grafiken, Musiken usw. zu laden. Die .sbx (also Schuhschachtel) - Dateien werden jedoch von hinten her gelesen. D.h. hinten ist das Inhaltsverzeichnis, kurz davor die Daten. Die .exe Dateien sind anders herum. Also, erst .exe Infos, dann die Daten. Jetzt kann man mit dem DOS-Befehl copy die Beiden zusammen in eine Datei packen, die dann etwa so aussieht:

.exe - Info
.exe - Programm
.sbx - Daten
.sbx - Info

Und kann diese .exe Datei mit SETSHOEBOX (vorher natürlich) anstatt einer .sbx angeben. Voilar, man hat nur eine .exe Datei in der alle Resourcen (Grafik, Sound, Musik...) sind.
#10617
Noch ein paar Helix-Varianten:

Code (glbasic) Select
// ------------------------------------------------------------- //
// -=#  CREATEHELIX  #=-
// Creates a helix aka. spiral object
// R1    : Raduis of Helix
// R2    : Radius of Helix Intersection
// Nu    : Number of elemtents along helix
// Nv    : Number of elements around intersection
// cycles: Number or spiral repetitions
// height: Complete length of the helix
// col   : Color of Helix-Material
// ------------------------------------------------------------- //
FUNCTION CreateHelix: num, R1, R2, Nu, Nv, cycles, height, col
LOCAL du, dv, u, v, x, y, z, tx, ty, q, nu, nv
du = cycles * 360 / Nu
dv = 360 / Nv

X_OBJSTART num
FOR i=0 TO Nu-1
u = i * du
FOR j=0 TO Nv-1
v = j * dv
FOR q = 0 TO 3
nu=0; nv=0 // Use next u/next v

IF q=0 OR q=3 THEN nu=1
IF q>1 THEN nv=1
nu = MOD(q, 2)
nv=INTEGER(q / 2)
qu = u+nu*du
qv = v+nv*dv

x = R1 * COS(qu) * (1 + COS(qv) * R2/R1)
z = R1 * SIN(qu) * (1 + COS(qv) * R2/R1)
y = SIN(qv)*R2 + qu*height/(360 * cycles)
tx = (i+nu)/Nu * cycles
ty = (j+nv)/Nv
X_OBJADDVERTEX x, y, z, tx, ty, col
NEXT
NEXT
X_OBJNEWGROUP
NEXT
X_OBJEND
ENDFUNCTION

Helicoid
Code (glbasic) Select
// ------------------------------------------------------------- //
// -=#  CREATEHELICOID  #=-
// Creates a helicoid - minimal surface of a helix
// R1    : Raduis of Helix
// Nu    : Number of elemtents along helix
// Nv    : Number of elements around intersection
// cycles: Number or spiral repetitions
// height: Complete length of the helix
// col   : Color of Helix-Material
// ------------------------------------------------------------- //
FUNCTION CreateHelicoid: num, R1, Nu, Nv, cycles, height, col
LOCAL du, dv, u, v, x, y, z, tx, ty, q, nu, nv
du = cycles*360 / Nu
dv = R1 / Nv

X_OBJSTART num
FOR i=0 TO Nu-1
u = i * du
FOR j=0 TO Nv-1
v = j * dv
FOR q = 0 TO 3
nu=0; nv=0 // Use next u/next v

IF q=0 OR q=3 THEN nu=1
IF q>1 THEN nv=1
nu = MOD(q, 2)
nv=INTEGER(q / 2)
qu = u+nu*du
qv = v+nv*dv

x = qv * COS(qu)
z = qv * SIN(qu)
y = qu/(cycles*360) * height
tx = (i+nu)/Nu * cycles
ty = (j+nv)/Nv
X_OBJADDVERTEX x, y, z, tx, ty, col
NEXT
NEXT
X_OBJNEWGROUP
NEXT
X_OBJEND
ENDFUNCTION
#10618
Hier ist der Quellcode für einfache 3D Objekte:

Eine Kugel
Code (glbasic) Select
// ------------------------------------------------------------- //
// -=#  SPHERE  #=-
// ------------------------------------------------------------- //
FUNCTION CreateSphere: num, r, n, col
LOCAL i,j, theta1, theta2, theta3, pi
pi = ACOS(0)*2
IF r < 0 THEN r = -r
IF n < 3 THEN n = 3

X_OBJSTART num
FOR j=0 TO n/2-1

theta1 = j * 2*pi / n - pi/2;
theta2 = (j + 1) * 2*pi / n - pi/2;
FOR i=0 TO n
theta3 = i * 2*pi / n;
X_OBJADDVERTEX r*COS(theta2) * COS(theta3), r*SIN(theta2), r*COS(theta2) * SIN(theta3), i/n, 2*(j+1)/n, col
X_OBJADDVERTEX r*COS(theta1) * COS(theta3), r*SIN(theta1), r*COS(theta1) * SIN(theta3), i/n, 2*j/n, col
NEXT
X_OBJNEWGROUP
NEXT
X_OBJEND
ENDFUNCTION // n


EinWürfel - jede Seite hat die gleiche Textur
Code (glbasic) Select
// ------------------------------------------------------------- //
// -=#  CREATECUBE  #=-
// ------------------------------------------------------------- //
FUNCTION CreateCube: num, sz, col
// Diese Variablen sind als LOCAL definiert:
// num, sz,
sz=sz/2
X_OBJSTART num
// Front Face
X_OBJADDVERTEX  sz, -sz,  sz, 1, 0, col
X_OBJADDVERTEX -sz, -sz,  sz, 0, 0, col
X_OBJADDVERTEX  sz,  sz,  sz, 1, 1, col
X_OBJADDVERTEX -sz,  sz,  sz, 0, 1, col
X_OBJNEWGROUP
// Back Face
X_OBJADDVERTEX -sz,  sz, -sz, 1, 1, col
X_OBJADDVERTEX -sz, -sz, -sz, 1, 0, col
X_OBJADDVERTEX  sz,  sz, -sz, 0, 1, col
X_OBJADDVERTEX  sz, -sz, -sz, 0, 0, col
X_OBJNEWGROUP
// Top Face
X_OBJADDVERTEX -sz,  sz,  sz, 0, 0, col
X_OBJADDVERTEX -sz,  sz, -sz, 0, 1, col
X_OBJADDVERTEX  sz,  sz,  sz, 1, 0, col
X_OBJADDVERTEX  sz,  sz, -sz, 1, 1, col
X_OBJNEWGROUP
// Bottom Face
X_OBJADDVERTEX  sz, -sz, -sz, 0, 1, col
X_OBJADDVERTEX -sz, -sz, -sz, 1, 1, col
X_OBJADDVERTEX  sz, -sz,  sz, 0, 0, col
X_OBJADDVERTEX -sz, -sz,  sz, 1, 0, col
X_OBJNEWGROUP
// Right face
X_OBJADDVERTEX  sz,  sz, -sz, 1, 1, col
X_OBJADDVERTEX  sz, -sz, -sz, 1, 0, col
X_OBJADDVERTEX  sz,  sz,  sz, 0, 1, col
X_OBJADDVERTEX  sz, -sz,  sz, 0, 0, col
X_OBJNEWGROUP
// Left Face
X_OBJADDVERTEX -sz, -sz,  sz, 1, 0, col
X_OBJADDVERTEX -sz, -sz, -sz, 0, 0, col
X_OBJADDVERTEX -sz,  sz,  sz, 1, 1, col
X_OBJADDVERTEX -sz,  sz, -sz, 0, 1, col
X_OBJNEWGROUP
X_OBJEND

ENDFUNCTION // sz

A Zylinder oder Kegel(stumpf)
Code (glbasic) Select
// ------------------------------------------------------------- //
// -=#  CREATECYLINDER - also creates a cone if any radius = 0  #=-
// ------------------------------------------------------------- //
FUNCTION CreateCylinder: num, baseRadius, topRadius, height, slices, stacks, col
LOCAL da, r, dr, dz, x, y, z, i, j
LOCAL x1, y1, x2, y2
da = 360 / slices
dr = (topRadius-baseRadius) / stacks
dz = height / stacks
X_OBJSTART num
FOR i=0 TO slices-1
x1 = COS(i*da)
y1 = SIN(i*da)
x2 = COS((i+1)*da)
y2 = SIN((i+1)*da)
z = 0
r = baseRadius

// Bottom lid
IF baseRadius>0
X_OBJADDVERTEX 0, 0, 0,  .5, .5, col
X_OBJADDVERTEX x1*r, y1*r, 0, x1/2+.5, y1/2+.5, col
X_OBJADDVERTEX x2*r, y2*r, 0, x2/2+.5, y2/2+.5, col
X_OBJNEWGROUP
ENDIF
// side
FOR j=0 TO stacks
X_OBJADDVERTEX x2*r, y2*r, z, (i+1)/slices,  j/stacks, col
X_OBJADDVERTEX x1*r, y1*r, z,  i   /slices,  j/stacks, col
z = z+dz
r = r+dr
NEXT
// Top lid
IF topRadius>0
X_OBJNEWGROUP
X_OBJADDVERTEX x2*r, y2*r, height, x2/2+.5, y2/2+.5, col
X_OBJADDVERTEX x1*r, y1*r, height, x1/2+.5, y1/2+.5, col
X_OBJADDVERTEX 0, 0, height,  .5, .5, col
ENDIF
X_OBJNEWGROUP
NEXT
X_OBJEND
ENDFUNCTION

Ein Torus (Donut)
Code (glbasic) Select
// ------------------------------------------------------------- //
// -=#  CREATETORUS  #=-
//
// By Samuel R. Buss
// http://math.ucsd.edu/~sbuss/MathCG
// ------------------------------------------------------------- //
FUNCTION CreateTorus: num, MinorRadius, MajorRadius, NumWraps, NumPerWrap, TextureWrapVert, TextureWrapHoriz
// Diese Variablen sind als LOCAL definiert:
// x, y,
// Draw the torus
LOCAL i, di, j, wrapFrac, wrapFracTex, phi, thetaFrac, thetaFracTex, theta
LOCAL x, y, z, r
X_OBJSTART num
FOR di=0 TO NumWraps-1
FOR j=0 TO NumPerWrap
FOR i=di+1 TO di STEP -1
wrapFrac = MOD(j, NumPerWrap)/NumPerWrap
wrapFracTex = j/NumPerWrap
phi = 360*wrapFrac
thetaFrac = (MOD(i, NumWraps)+wrapFracTex)/NumWraps
thetaFracTex = (i+wrapFracTex)/NumWraps
theta = 360*thetaFrac
r = MajorRadius + MinorRadius*COS(phi)
x = SIN(theta)*r
z = COS(theta)*r
y = MinorRadius*SIN(phi)
X_OBJADDVERTEX x,y,z,  thetaFracTex*TextureWrapVert, wrapFracTex*TextureWrapHoriz, RGB(255, 255, 255)
NEXT
NEXT
X_OBJNEWGROUP
NEXT
X_OBJEND
ENDFUNCTION
#10619
Ja. Ich habe ein kleines Beispiel erstellt, dass das verdeutlicht:
Schuschachtel-Alleinstehend
Die Schuhschachtel-Dateien (.sbx) werden rückwärts gelesen und die .exe Dateien liest das Betriebssystem von vorne. Daher kann man an die .exe eine .sbx anhängen und aus der .exe die Resourcen laden.
#10620
Yes. I've made a little sample program that is located here:
ShoeBox-Standalone
The shoebox .sbx files get read backwards and the .exe files get read forwards by the operating system. Thus, you can concatenate both and load the resources from the attached shoebox in the .exe file.