simple 3d with bmax 2D

BlitzMax Forums/BlitzMax Programming/simple 3d with bmax 2D

Robert Cummings(Posted 2006) [#1]
Hi,

I need to have one simple 3D object in my otherwise 2D game - it is just a simple 3D object which is textured with a single texture, and I only need to position, rotate and scale it into the scene in a cross platform friendly way.

Do you think it's possible to do this easily with current blitzmax and still use max2D for the background behind it and particles in front of it?


N(Posted 2006) [#2]
Do you plan on using just OpenGL or just Direct3D? If so, and since you mention it being cross platform, OpenGL would be your only option, and so yes, it should be easy enough as long as you're comfortable messing with GLMax2D to add state saving (or use glPushAttrib/glPushClientAttrib/glPushMatrix for all settings). There'd probably be a fair bit of code mangling, but it's doable.

However, if you plan on supporting Direct3D7 AND OpenGL, then you're going to be in a world of pain.


Robert Cummings(Posted 2006) [#3]
I am desiring DX7 for the windows platform, yeah - so world of pain it would be. I guess I'll just have to work around it. Thanks anyway dude.


Chris C(Posted 2006) [#4]
you could always pre-render an animation of a 3d shape, just a thought


TartanTangerine (was Indiepath)(Posted 2006) [#5]
Yes it's possible in DX7 but it could be a load more work than it would be in OGL. BMAX does give you access to 99% of the DX7 command set, it's just very different to OGL and not as easy to get to.

If you don't mind building your own model then you could use my textured poly module, it can build solid models from triangle strips, you just provide the vertex co-ords (x,y & z), normals, UV and vertex color. You'd have to do your own translations though but that's kids play :D You can then use my Lighting module for direction/spot lights etc...

And yeah it's cross platform and does support backface culling.