Utah Teapot for BlitzMax

Community Forums/Showcase/Utah Teapot for BlitzMax

Difference(Posted 2004) [#1]
I just ported this from OpenGL Direct.

teapot_test.bmx:

teapot.bmx :


[EDIT]: From sjbaker.org/teapot/ : "It is noticable that the original teapot data has no bottom. Some of the data sets that are out there (depressingly, this includes the one in the GLU and GLUT distributions) have added a bottom - but that is definitely 'impure'."


Jim Teeuwen(Posted 2004) [#2]
You know what's interesting?
The | operator in the line 'bglCreateContext 800,600,32,0,BGL_BACKBUFFER|BGL_DEPTHBUFFER'

Isnt that supposed to be 'Or'?
I tried it and it seems to work just fine. It's a bit weird that the & character (And operator in basic) doesn't work this way.

edit:
the & character seems to work as well, but it does not yield the same result as 'And'

Print( $342005 And $ff9900 )
Print( $342005 & $ff9900 )


outputs:
16750848
3407872

Infact, after trying, so does the | character. It does not give the same results as 'Or'.


bradford6(Posted 2004) [#3]
Awesome demo. Amazing how clear the OpenGL code is and this is without the BRL 3D module


VIP3R(Posted 2004) [#4]
Great demo Peter :)

This OpenGL stuff is looking really promising.


kraft(Posted 2004) [#5]
Dare I say it......we almost don't need a BlitzMax 3D module with this direct OpenGL access!! ;)

Cool conversion Peter


dmaz(Posted 2004) [#6]
Defiance:
Whenever trying to "add" options use a pipe ("|"), while when testing use "or". The | is a bitwise 'or' and the & is a bitwise 'and', meaning that they do as you are expecting. "and" and "or" are used only for conditional expressions. This means they return true or false only. usaully 1 or 0.

Print %001 | %010
Print %001 Or %010


Steve Elliott(Posted 2004) [#7]
Great demo - but isn't that teapot supposed to have a base?


Difference(Posted 2004) [#8]
@Steve: Thanks. Read the last line on this page: http://sjbaker.org/teapot/ :D


Steve Elliott(Posted 2004) [#9]
That's OK then - just wanted to check there wasn't a graphics driver problem.

Can you use the data for the bottom on that page in your program though?


Difference(Posted 2004) [#10]
Not without upsetting Steve Baker.


Caff(Posted 2004) [#11]
nice demo...


puki(Posted 2004) [#12]
Yeh, this runs okay - the picture I saw in IRC sort of looked a bit wonky - but this runs great.


Damien Sturdy(Posted 2004) [#13]

we almost don't need a BlitzMax 3D module with this direct OpenGL access!!



True.... ive started a 3d engine and ive got multiple cameras and the basic movement working.. need a hand with local movement though... (il look into it later).. but until then, does anyone want to get involved with it? Its based of the Glhead demo.


puki(Posted 2004) [#14]
I mentioned this in IRC to "Drago" today - the ability to do it direct is like a massive Christmas present. I wonder if anyone has thought of trying to import in the BasicGL demos?


Panno(Posted 2004) [#15]
wow Peter its a cool teapot demo !
runs fine here


Phish(Posted 2004) [#16]
I want my Max3D module. Now :-( *sniff* Or I'll have a tantrum!