UnderwareDESIGN

PlayBASIC => 3D Development => Topic started by: kevin on August 19, 2006, 09:02:43 AM

Title: Texture Mapped Terrain
Post by: kevin on August 19, 2006, 09:02:43 AM
  Textured Face Terrain (old school 3D in PlayBasic)

 This demo creates a Textured 3D polygon landscape using mesh & rotation commands found in PlayBasic.
 

 Controls:

   Space Bar= Create a new terrain

   Up Arrow = Move Camera Forward
   Down Arrow = Move Camera Back
   
   Mouse = Mouse Look


  Download

  [plink] Download Demo (Exe) (http://www.underwaredesign.com/files/demos/PB_3D_Textured_Terrain.zip) [/plink]

  [plink]  Get Source Code from the PlayBasic Code Tank (http://www.underwaredesign.com/pbct/pbct_dataview.php?key=37) [/plink]
 
Title: Re: Texture Mapped Terrain
Post by: hatonastick on August 19, 2006, 09:32:39 AM
Hmm I get a couple of errors when I try to compile this with PlayBASIC 1.46.
Line 639, error number 415.  Expecting user defined function.
ProjectionX#,ProjectionY#   =GetVertexObjectProjection(CameraObject)
Title: Re: Texture Mapped Terrain
Post by: kevin on August 19, 2006, 09:42:19 AM
 The code required requires PlayBASICv1.47  (look in the maintainence forum it was released today/yesterday )

The update/patch thread can be found here. [plink] Get  Retail Patches  (http://www.underwaredesign.com/forums/index.php?topic=1182.15)[/plink]

Note: - It Might be an idea to install  update PlayBASIC V147 and PlayBASIC V147b   As the former has some doc updates.



Title: Re: Texture Mapped Terrain
Post by: hatonastick on August 19, 2006, 01:44:11 PM
Whoops I had installed 1.47b first.  Easy fixed though.  Will try it again - looks very interesting!

Yup it works fine now.  Nice job!  So when can I start working on a remake of Magic Carpet?  ;D J/k.
Title: Re: Texture Mapped Terrain
Post by: kevin on February 16, 2007, 10:41:50 AM
  Textured Terrain Update in  PB1.65

You may or may not be aware that PB1.64 and above now have hardware 3d acceleration.   This piccy shows the original Texture Terrain example (from the PB demo) running in the new version with a couple of small changes.   

1) The texture is loaded and cut up as 3D images rather than FX images
2) The mesh builder routine assigns alpha 50 draw mode to all polygons.  So all tri's are alpha'd to the display   

  Unlike a normal hardware 3d engine, this demo is rendering every triangle to the screen + off screen as separate draw calls (not one draw call!).   This combined with the separation of the terrain texture into many small separate textures,  is a real no no 3D acceleration terms.

But anyway, it still runs nice enough to the get the idea :)
 
Title: Re: Texture Mapped Terrain
Post by: Draco9898 on February 16, 2007, 11:00:26 AM
that's really neat...got an executable of it? I want to see the frames per second.

cant wait to play with this stuff :)