Author Topic: Sprite Rotation in 3D  (Read 1411 times)

Offline WPShadow

  • Administrator
  • Prof. Inline
  • *******
  • Posts: 1667
    • View Profile
    • http://lostrevenant.blogspot.com
Sprite Rotation in 3D
« on: 2009-Nov-06 »
Hi!

Gibt es irgendeine Möglichkeit ein Sprite in 3D rotieren zu lassen? X_Rotation funktioniert ja logischerweise nicht.

Gruß

W.
AMD X2 4600, 2 GB Ram, ATI X1950 XTX, XP PRO SP2: GLB Premium 10.beta_dingsi, <(´.´<) Kirby Dance (>`.`)>
http://lostrevenant.blogspot.com
alea iacta est

Offline WPShadow

  • Administrator
  • Prof. Inline
  • *******
  • Posts: 1667
    • View Profile
    • http://lostrevenant.blogspot.com
Re: Sprite Rotation in 3D
« Reply #1 on: 2009-Nov-07 »
Klingt gut!

Ich schaue mal, was ich da zusammen bekomme, falls es nicht geht, schreie ich einfach...  :good:
AMD X2 4600, 2 GB Ram, ATI X1950 XTX, XP PRO SP2: GLB Premium 10.beta_dingsi, <(´.´<) Kirby Dance (>`.`)>
http://lostrevenant.blogspot.com
alea iacta est

Offline Schranz0r

  • Premium User :)
  • Administrator
  • Prof. Inline
  • *******
  • Posts: 5077
  • O Rly?
    • View Profile
Re: Sprite Rotation in 3D
« Reply #2 on: 2009-Nov-07 »
Code: (glbasic) [Select]
STARTPOLY -1, FALSE
 POLYVECTOR 0,0,  0,0, RGB(0x00, 0x00, 0x80)
 POLYVECTOR 0,128, 0,0, RGB(0x00, 0x80, 0xff)
 POLYVECTOR 128,128, 0,0, RGB(0x00, 0xff, 0x80)
 POLYVECTOR 128,0, 0,0, RGB(0xff, 0xff, 0x40)
ENDPOLY
PRINT "GLBASIC ROCKS!",10,60
GRABSPRITE 1,0,0,128,128

X_OBJSTART 1
 X_OBJADDVERTEX 5,5,0,   0,0, RGB(0xff, 0xff, 0xff)// links oben
 X_OBJADDVERTEX -5,5,0,   1,0, RGB(0xff, 0xff, 0xff)// rechts oben
 X_OBJADDVERTEX 5,-5,0,   0,1, RGB(0xff, 0xff, 0xff)// links unten
 X_OBJADDVERTEX -5,-5,0,  1,1, RGB(0xff, 0xff, 0xff)// rechts unten
X_OBJEND
 
LOCAL phi

WHILE TRUE
 X_MAKE3D 1,1000,45
 X_CAMERA 0,0, -20,  0,0,0
 
 INC phi,1
 IF phi = 89 THEN phi = 269
 IF phi > 359 THEN phi = 0
 
 X_ROTATION phi,0,1,0
 X_SETTEXTURE 1,-1
 X_DRAWOBJ 1,0
 X_MAKE2D
 
 PRINT "Rotation: "+phi,10,10
SHOWSCREEN
WEND
END

I <3 DGArray's :D

PC:
AMD Ryzen 7 1700 @3.9GHz, 16GB HyperX Fury 3000MHz Ram, ASUS ROG GTX 1060 STRIX 6GB, Windows 10 Pro 64Bit, MSi Tomahawk B350 Mainboard