I'm trying some 3D stuff and I created some cubes and spheres in code using X_OBJSTART, X_OBJADDVERTEX, X_OBJEND etc. I really like the flat shaded 3D objects. They look kind of oldschool, like Virtua Racer or Star Fox for SNES. See image below what I mean with flat shaded, the red sphere on the left-hand side. 8)
(http://static.ddmcdn.com/gif/question484-shading.gif)
So now I wanted to create some more interesting objects, other than the simple cube or sphere. So I'm using AC3D as a model editor, export it to 3ds file and convert it to .ddd using Convert3D tool.
But when I load the resulting .ddd object, it looks like the objects aren't lighted or shaded correctly. See image below, I draw a row of the same object, using X_MOVEMENT, X_ROTATION around y-axis and then X_DRAWOBJ.
(http://i45.tinypic.com/2ryhok2.png)
The colors between the 2 example are slightly different because of material settings in AC3D, so that's not the problem.
The top halve is 1 object created in code with X_OBJSTART, X_OBJADDVERTEX, X_OBJEND, and when I draw a row of this one object it show correctly. The bottom halve is a cube created with AC3D, loaded from X_LOADOBJ. The shade of the bottom part of each cubes is different. This is not expected, because the bottom parts are all facing the same direction. There is a X_SPOT_LT with same position and angle as X_CAMERA, so the light is comming directly from the view angle.
I've tried changing X_AUTONORMALS before doing X_LOADOBJ but that doesn't make any difference. Do I need to set some surface properties in AC3D before exporting it? O_O
Oops never mind :x I can answer my own question..
I just found out about the AC3D plug-in. I copied the ddd_export.p file from \GLBasic_v11\Plugins\AC3D\ into the AC3D plugin folder, and it gives improved result.
=D It now looks exactly the same as the cubes created from code.
Hi Bdr, for 3D my counsil it's uses the Opengl Port of Kanonet or mine (sorry I think it's in the 3D thread but I don't stay sure).
The Kano library I think it's more easy for use... but whit the both you can have very very nice effects over the 3D surfaces... GLbasic in default it's a bit poor whit the 3D...
You will add specular and shinnes and chnaging a lot of thing in the lighting...
PS: If use my library , and you don't undertand too much, send me a PM, and I try to answer, I don't rebember too much what I did :P
BdR for lighting maybe you will find this post (http://www.glbasic.com/forum/index.php?topic=8309.msg72914#msg72914) interesting, my light fixes are linked there too.