I don't know what's going on. I recommend you start over from "demo - advanced 3D". I tried a few things, black screen, unending. Of course we all wish we knew what was wrong...
Another good starting point is a demo XL2 gave me.
http://forum.jo-engine.org/index.php?action=dlattach;topic=864.0;attach=121A few things I noticed in the code that is going to cause problems in the future:
void move_cam(void)
{
jo_3d_camera_set_viewpoint(&cam,cam_pos[0],cam_pos[1],cam_pos[2]);
jo_3d_camera_set_target(&cam,cam_tar[0],cam_tar[1],cam_tar[2]);
}
Do not do this! These are not 3D functions, they change where the projection plane is. They do not navigate the camera in 3D space. Just don't change these values.
A good way to set display parameters. I first got this snippet from XL2.
void initCamera(jo_camera * curCam)
{
(*curCam).viewpoint[X] = toFIXED(0.0);
(*curCam).viewpoint[Y] = toFIXED(0.0);
(*curCam).viewpoint[Z] = toFIXED(5.0);
(*curCam).z_angle = DEGtoANG(0.0);
(*curCam).target[X] = toFIXED(0.0);
(*curCam).target[Y] = toFIXED(0.0);
(*curCam).target[Z] = toFIXED(0.0);
slWindow(0, 0, JO_TV_WIDTH-1, JO_TV_HEIGHT-1, draw_distance, JO_TV_WIDTH_2, JO_TV_HEIGHT_2);
slPerspective(DEGtoANG(90)); //FOV
}
You don't need to set slZdspLevel(7); with that above snippet. slPerspective does that.
int index;
for(index = 0; index < num_object; index++)
{
draw_object(&object[index]);
}
Can you explain that one? The whole game is already a loop, it isn't going to miss an object when it needs to render it. Unless this is some anachronism of you needing to display a hard-coded mesh. (that's probably it)
Also, 3D objects need to be pushed into a matrix, and then populated. Changing that doesn't fix your problem but it's likely part of it. (display_mesh_mesh needs to be part of a matrix)
Also, the saturn does not support texture coordinates. Thus, you can't texture map with UV. Texture mapping for the Saturn basically amounts to assigning a texture to a polygon then changing the texture until it looks right. If you have a large texture and want to span it over multiple polygons, you have to break that texture down manually into the pieces that will be assigned to their specific polygons.