ASC II 3D Object Loader / Viewer V0.02
This example loads an ASC formatted 3d object made of vertex and face list into memory and renders the result to fixed position camera.
Keys:
Space = Change Draw Mode
Arrows = Change High light face
H = Toggle Face highlights ON/OFF
Enter = Toggle Back faces
ESC = Quit
Requirements:
Due to a capture to scene bug with Gouraudquad, this examples requires PlayBASIC V1.64O Beta 16 (or higher) to function correctly.
Related Examples:
* Textured Tunnel (http://www.underwaredesign.com/forums/index.php?topic=3824.0)
* Rotated Column (http://www.underwaredesign.com/forums/index.php?topic=3820.0)
* Timer Based Movement Star Field (http://www.underwaredesign.com/forums/index.php?topic=3618.0)
* Z Depth Perspective For Sprites (http://www.underwaredesign.com/forums/index.php?topic=3528.0)
* Manual Projection/Scene Perspective (http://www.underwaredesign.com/forums/index.php?topic=3279.0)
* 2.5D Rugby Source (http://www.underwaredesign.com/forums/index.php?topic=2980.0)
Download:
Attached.
Thanks kevin for the help.
It does'nt do texturemapping but it gives me some ideas.
QuoteIt does'nt do texturemapping but it gives me some ideas.
Never said it did.. But For texture mapping, replace the Tri/Quad, GouraudTri, GouraudQuad calls with TextureTr, TextureQuad calls and hey presto it's texture mapped. But it's affine (linear) texture mapping, so it won't be perspectively correct.
You can approximate perspective with linear mapping by using subdivision techniques. Which can help remove some of the shearing by products that occur due to the linear interpolation. There's actually an example of this in the standard PlayBASIC example pack (http://www.playbasic.com/downloads.php), as well as various 3d (6dof) examples.