On Mon, Jun 12, 2006 at 02:32:40PM +0200, Frank Barknecht wrote:
Hallo, Frank Barknecht hat gesagt: // Frank Barknecht wrote:
Third: With some more work it should possible to store single vertices with 3 coordinates on each line in this textfile, and then collect 3 lines on every gemhead-bang. This basically is the format of an *.obj-file, where vertices start with the letter "v". So with
[textfile] <= open some obj-file here | [route v] | [sx/objblob] <= TODO
you would get a custom, primitive obj-file renderer.
I've played with this idea some more and attached is the first result, which uses the patches from prev. mail. It can load and display an obj-file which is based on triangle faces (no quad faces yet.) I used some more externals: [repack] and [s2l] from zexy, and [list-drip] from list-abs, which can be replaced with drip or repack, if you like. Also attached is a test-obj-file displaying a torus.
This caused my GEM to lock up, but it's probably something I've done wrong on my end. I get the idea though, and it's really cool work! I will take what you've done here and do some more work on warping lists of faces and post the results when I'm done. Thanks for the tips.
For some unknown reason the normals of the faces aren't quite right.
This could have to do with the way that OBJ files store the normals of each face in another list (prefixed with 'vn') whilst my hack assumes correctly wound polys in order to determine the normal direction.
I think I might also be able to make it faster by using a [primTri] instead of separate GL calls to draw faces manually, and not recaculating all information every time.
Best,
Chris.
chris@mccormick.cx http://mccormick.cx