http://www.youtube.com/watch?v=aqrV7u06-xw
This is a maze demo project included in GLBASIC to show HANGUL msg
But as you can see, textures looks as if it doen't do perspective collection. I attach src code here.
1. How can I fix it to show textur correctly?
2. Hangul disappeared in wiz except for -==-. What's the problem with Hangul System for wiz?
now I use V7 of GLBASIC.
This is a maze demo project included in GLBASIC to show HANGUL msg
But as you can see, textures looks as if it doen't do perspective collection. I attach src code here.
1. How can I fix it to show textur correctly?
2. Hangul disappeared in wiz except for -==-. What's the problem with Hangul System for wiz?
now I use V7 of GLBASIC.
Code (glbasic) Select
// --------------------------------- //
// Project: MAZE
// Start: 수요일, 8월 12, 2009
// IDE Version: 7.078
SETCURRENTDIR("Media") // seperate media and binaries?
// --------------------------------- //
// Project: 3D Maze
// Start: Friday, October 03, 2003
// IDE Version: 1.30929
// This is a very simple demo of how to move in a 3D world
// It's not optimized at all and designed as a simple tutorial
// only.
// Das ist ein ganz einfaches Demo wie man sich in einer 3D
// Welt bewegt. Es ist nicht optimiert und dient nur als
// einfaches Tutorial.
Nothing changed in load level function.
GLOBAL mx, my, b1, b2
GLOBAL Level[]
LOADANIM "hangul1.bmp", 101, 8,16
// do some text. This should look "hangul" to you, when you
// set the correct font with menu: Edit/Editor Outfit
// set the correct font with menu: Edit/Editor Outfit
str$ = "안녕하세요 여러분.이 글이 보이시나요?\n" _
+ "그렇다면 반갑습니다. -=바이퍼=-\n"
DIM Level[0] // We load the level later / laden wir sp?er
sz = 50 // Size of a 'block' / Gr秤e eines 'Blockes'
ply_x = sz*2 // Start Position
ply_y = sz*2
ply_dir = 0 // Current rotation direction / aktuelle drehrichtung
LoadLevel (1, sz, Level[])
// Load texture - sprites
// Textur-sprites laden
LOADSPRITE "b1.bmp", 0
LOADSPRITE "w1.bmp", 1
WHILE TRUE
dtime = GETTIMER()
// Show FPS / FPS anzeigen
fps = ((1000/dtime)+fps)/2
delay=delay+dtime
IF delay>1000 // 1/2 sec
delay=0
ShowFPS=fps
ENDIF
// limit on slow machines / begrenzen f. langsame Rechner
dtime = MIN(dtime, 16)
// For nicer textures / f? sch?ere Texturen
//X_MIPMAPPING TRUE
// 3D Viewport
X_MAKE3D 1, 800, 45
// Set Camera / Kamera setzen
X_CAMERA ply_x, sz*.75+KEY(29)*120, ply_y-5, ply_x+COS(ply_dir)*sz, sz*.7, ply_y+SIN(ply_dir)*sz
// Only draw front faces / Nur vorferseiten zeichnen
X_FOG RGB(15,15,15), TRUE, 0.003, 0
X_CULLMODE 1
// Draw walls / W?de zeichnen
X_SETTEXTURE 0, -1
X_DRAWOBJ 0,0
// Floor+Ceiling / Boden und Decke
X_SETTEXTURE 1, -1
X_DRAWOBJ 1,0
// Floor and walls are different objects, since GLBasic handles
// one texture per object. You could have drawn all needed
// Textures in one sprite and use texture coordinates
// to display only parts of the sprite - would be faster
// Boden und W?de sind 2 Objekte, da GLBasic jedem Objekt eine
// eingene Textur zuweist. Man kann alle ben?igten Texturen in
// ein Sprite zeichnen und dann mit Texturkoordinaten nur
// einen Bereich davon verwenden - das w?e schneller
mx=MOUSEAXIS(0)*dtime/100
my=0
IF KEY(200) THEN my=1
IF KEY(208) THEN my=-1
IF KEY(203) THEN mx=-1
IF KEY(205) THEN mx=1
//my=MOUSEAXIS(1)*dtime/1000
// Remember current position / Aktuelle Position merken
ply_x_old = ply_x
ply_y_old = ply_y
// Try moving in 'x' / Versuchen in 'x' Richtung zu bewegen
ply_x=ply_x+my*COS(ply_dir)*sz*dtime/1000
// IF X_COLLISIONAABB(0,0,ply_x, sz/2, ply_y, sz/4, sz/2, sz/4) THEN ply_x=ply_x_old
IF X_COLLISION(0, 0, sz/4, ply_x, sz/2, ply_y) THEN ply_x = ply_x_old
ply_y=ply_y+my*SIN(ply_dir)*sz*dtime/1000
// Try moving in 'y' / Versuchen in 'y' Richtung zu bewegen
// IF X_COLLISIONAABB(0,0,ply_x, sz/2, ply_y, sz/4, sz/2, sz/4) THEN ply_y=ply_y_old
IF X_COLLISION(0, 0, sz/4, ply_x, sz/2, ply_y) THEN ply_y = ply_y_old
// Turn player / Spieler drehen
ply_dir=ply_dir+mx
X_MAKE2D
// Just to be safe, that some buggy driver
// might add a few pixels, turn to
// nearest pixel interpolation mode.
SMOOTHSHADING FALSE
// Print the text str$, using "animation" font 101 (see above)
// and x,y position 100,100
HANGUL(101, 10,0, str$)
// Visualize level data in 2D / Level Daten in 2D zeichnen
//ALPHAMODE 1
//FOR x=0 TO BOUNDS(Level[], 0)-1; FOR y=0 TO BOUNDS(Level[], 1)-1
// IF Level[x][y] THEN DRAWRECT x*16, y*16+20, 16, 16, RGB(128,128,128)
//NEXT;NEXT
//DRAWRECT ply_x*16/sz-4, ply_y*16/sz+20-4, 7, 7, RGB(255,255,255)
//ALPHAMODE 0
PRINT "FPS:"+INTEGER(ShowFPS)+" px:" + INTEGER(ply_x) + " py:" + INTEGER(ply_y) + " d:" + INTEGER(ply_dir), 0 ,230
SHOWSCREEN
WEND