Sprite3DReal Userlibrary

Developed or developing a new product in PureBasic? Tell the world about it.
S.M.
Enthusiast
Enthusiast
Posts: 118
Joined: Sat Apr 24, 2004 1:11 pm
Contact:

Post by S.M. »

@Psychophanta

Is S3DR_TestCollision() not enough ? :)
regards
Stefan
Shannara
Addict
Addict
Posts: 1808
Joined: Thu Oct 30, 2003 11:19 pm
Location: Emerald Cove, Unformed

Post by Shannara »

Heh, any news on an update/fix to the library?
User avatar
Psychophanta
Always Here
Always Here
Posts: 5153
Joined: Wed Jun 11, 2003 9:33 pm
Location: Anare
Contact:

Post by Psychophanta »

S.M. wrote:@Psychophanta

Is S3DR_TestCollision() not enough ? :)
regards
Stefan
Hi,
Well, mmm... Where is the doc? :)

Albert
http://www.zeitgeistmovie.com

while (world==business) world+=mafia;
Shannara
Addict
Addict
Posts: 1808
Joined: Thu Oct 30, 2003 11:19 pm
Location: Emerald Cove, Unformed

Post by Shannara »

Heh, I think he forgot about this project or is too busy to post :P
User avatar
Psychophanta
Always Here
Always Here
Posts: 5153
Joined: Wed Jun 11, 2003 9:33 pm
Location: Anare
Contact:

Post by Psychophanta »

yes :roll:
http://www.zeitgeistmovie.com

while (world==business) world+=mafia;
S.M.
Enthusiast
Enthusiast
Posts: 118
Joined: Sat Apr 24, 2004 1:11 pm
Contact:

Post by S.M. »

Sorry. There is no update for now. :(
I hadn't much free time.(But maybe I will have time at this weekend :D )
regards
Stefan
S.M.
Enthusiast
Enthusiast
Posts: 118
Joined: Sat Apr 24, 2004 1:11 pm
Contact:

Post by S.M. »

Hi

Here is a small update: :wink:
Sprite3DReal 1.1beta

Changes:

Code: Select all

- S3DR_FreeZBuffer() is called automatically
- Converter for x-files added
- support for Meshes
regards
Stefan
Shannara
Addict
Addict
Posts: 1808
Joined: Thu Oct 30, 2003 11:19 pm
Location: Emerald Cove, Unformed

Post by Shannara »

Cool, can't wait till you fix the color bug :)
User avatar
Psychophanta
Always Here
Always Here
Posts: 5153
Joined: Wed Jun 11, 2003 9:33 pm
Location: Anare
Contact:

Post by Psychophanta »

Moebius,
if you take a look here you'll see the importance of collision detection :wink:
viewtopic.php?t=14507
http://www.zeitgeistmovie.com

while (world==business) world+=mafia;
Shannara
Addict
Addict
Posts: 1808
Joined: Thu Oct 30, 2003 11:19 pm
Location: Emerald Cove, Unformed

Post by Shannara »

Cool News
User avatar
Psychophanta
Always Here
Always Here
Posts: 5153
Joined: Wed Jun 11, 2003 9:33 pm
Location: Anare
Contact:

Post by Psychophanta »

Hi,
Is stopped this project, or aborted?
http://www.zeitgeistmovie.com

while (world==business) world+=mafia;
S.M.
Enthusiast
Enthusiast
Posts: 118
Joined: Sat Apr 24, 2004 1:11 pm
Contact:

Post by S.M. »

@Psychophanta
neither stopped nor aborted. I hadn't much free time.
But here is a new version: :D
Sprite3DReal v1.2

regards
Stefan
User avatar
Psychophanta
Always Here
Always Here
Posts: 5153
Joined: Wed Jun 11, 2003 9:33 pm
Location: Anare
Contact:

Post by Psychophanta »

S.M. wrote:@Psychophanta
neither stopped nor aborted. I hadn't much free time.
But here is a new version: :D
Sprite3DReal v1.2
I see.
THANX :!: :D
http://www.zeitgeistmovie.com

while (world==business) world+=mafia;
Shannara
Addict
Addict
Posts: 1808
Joined: Thu Oct 30, 2003 11:19 pm
Location: Emerald Cove, Unformed

Post by Shannara »

Looks nice :) Any chance to add into the readme file what bugs were fixed as well?
Shannara
Addict
Addict
Posts: 1808
Joined: Thu Oct 30, 2003 11:19 pm
Location: Emerald Cove, Unformed

Post by Shannara »

Here is the newest update, the tile is now 32x32, yet the library stretches it out to 256x256 .. maybe I am doing something wrong ..?

Code: Select all

Global SprWidth.l
Global SprHeight.l

InitSprite()
InitSprite3D()
InitKeyboard()

OpenWindow(1,0,0,800,600,#PB_Window_ScreenCentered,"Texture Coordinates")
OpenWindowedScreen(WindowID(),0,0,800,600,0,0,0)

S3DR_CreateZBuffer()

;LoadSprite(1, "grass.bmp",#PB_Sprite_Texture)
CreateSprite(1, 32,32,#PB_Sprite_Texture)
StartDrawing(SpriteOutput(1))
Box(0,0,32,32,RGB(255,255,255))
StopDrawing() 
SprWidth = SpriteWidth(1)
SprHeight = SpriteHeight(1)

Quit = #False
Repeat
  EventID.l = WindowEvent()
  If EventID = #PB_Event_CloseWindow  ; If the user has pressed on the close button
    Quit = #True
  EndIf
  
  Start3D()
  
  S3DR_BeginReal3D()
  
  S3DR_ClearScreenAndZBuffer(#blue)
  
  S3DR_SelectTexture(1)
  S3DR_SetDiffuseColors(RGB(0,255,0),RGB(255,0,0),RGB(0,0,255),RGB(0,0,0))
  ;S3DR_SetDiffuseColors(RGB(0,0,255),RGB(0,0,255),RGB(0,0,255),RGB(0,0,255))
  
  X1=10
  Y1=10
  
  X2=SprWidth-10
  Y2=10
  
  X3=10
  Y3=SprHeight-10
  
  X4=SprWidth-10
  Y4=SprHeight-10
  
  ;convert the pixel-coordinates to texture-coordinates.
  TU1.f=X1/SprWidth
  TV1.f=Y1/SprHeight
  
  TU2.f=X2/SprWidth
  TV2.f=Y2/SprHeight
  
  TU3.f=X3/SprWidth
  TV3.f=Y3/SprHeight
  
  TU4.f=X4/SprWidth
  TV4.f=Y4/SprHeight
  
  
  ; tu1,tv1     tu2,tv2
  ;    +---------+
  ;    |         |
  ;    |         |
  ;    |         |
  ;    |         |
  ;    |         |
  ;    +---------+
  ; tu3,tv3     tu4,tv4
  
  
  S3DR_SetTextureCoordinates(TU1.f,TV1.f,TU2.f,TV2.f,TU3.f,TV3.f,TU4.f,TV4.f)
  
  ;             X1  Y1  Z1  X2  Y2  Z2  X3  Y3  Z3  X4  Y4  Z4
  S3DR_Draw3D(  -1,  1,  5,  1,  1,  5, -1, -1,  5,  1, -1,  5);draws the selected sprite
  
  S3DR_EndReal3D()
  
  Stop3D()
  
  FlipBuffers()
  
  ExamineKeyboard()
  If KeyboardPushed(#PB_Key_Escape)
    Quit = #True
  EndIf
Until Quit = #True

S3DR_FreeZBuffer()

Post Reply