3D is easy with OpenGL && SFML;
SFML integrates OpenGL to the heart's content
Game programming is quite complex even in 2D but with 3D you need to take care of a lot and it's not just adding a few more lines of code....
Heres your few more lines of code
C++ rendering with OpenGL:
void RenderWindow::BufferObject(DisplayedBeing3D *mesh){
if (mesh->_Culling){
glEnable (GL_CULL_FACE);
glLightModeli( GL_LIGHT_MODEL_TWO_SIDE, 0);//cull lighting
}else{
glDisable (GL_CULL_FACE);
glLightModeli( GL_LIGHT_MODEL_TWO_SIDE, 1);
}
if (!mesh->_Anchored){
ApplyGravity(mesh,_TimeBetweenFrames);
ApplyVelocity(mesh,_TimeBetweenFrames,0,_LengthOfMeter);
}
glBindTexture(GL_TEXTURE_2D, *mesh->GetTexture());
glColor4f(1.f, 1.f, 1.f, 0.f);
if (mesh->_SmoothShading){
for (unsigned int i=0;i<mesh->GetFaces()->size();++i){
if (mesh->GetFace(i)->GetSize() == 3){
glBegin(GL_TRIANGLES);
for (unsigned int j=0; j<3; ++j){
glNormal3f( mesh->GetVertNormal(mesh->GetFace(i)->GetVert(j)).x, mesh->GetVertNormal(mesh->GetFace(i)->GetVert(j)).y, mesh->GetVertNormal(mesh->GetFace(i)->GetVert(j)).z );
glTexCoord2f( mesh->GetTexVert(mesh->GetFace(i)->GetTexVert(j)).x, mesh->GetTexVert(mesh->GetFace(i)->GetTexVert(j)).y);
glVertex3f( mesh->GetVert(mesh->GetFace(i)->GetVert(j)).x, mesh->GetVert(mesh->GetFace(i)->GetVert(j)).y, mesh->GetVert(mesh->GetFace(i)->GetVert(j)).z);
}
glEnd();
}else{
glBegin(GL_QUADS);
for (unsigned int j=0; j<4; ++j){
glNormal3f( mesh->GetVertNormal(mesh->GetFace(i)->GetVert(j)).x, mesh->GetVertNormal(mesh->GetFace(i)->GetVert(j)).y, mesh->GetVertNormal(mesh->GetFace(i)->GetVert(j)).z );
glTexCoord2f( mesh->GetTexVert(mesh->GetFace(i)->GetTexVert(j)).x, mesh->GetTexVert(mesh->GetFace(i)->GetTexVert(j)).y);
glVertex3f( mesh->GetVert(mesh->GetFace(i)->GetVert(j)).x, mesh->GetVert(mesh->GetFace(i)->GetVert(j)).y, mesh->GetVert(mesh->GetFace(i)->GetVert(j)).z);
}
glEnd();
}
}
}else{
for (unsigned int i=0;i<mesh->GetFaces()->size();++i){
sf::Vector3<float> normal = mesh->GetFace(i)->GetNormal();
glNormal3f(normal.x,normal.y,normal.z);
if (mesh->GetFace(i)->GetSize() == 3){
glBegin(GL_TRIANGLES);
for (unsigned int j=0; j<3; ++j){
glTexCoord2f( mesh->GetTexVert(mesh->GetFace(i)->GetTexVert(j)).x, mesh->GetTexVert(mesh->GetFace(i)->GetTexVert(j)).y);
glVertex3f( mesh->GetVert(mesh->GetFace(i)->GetVert(j)).x, mesh->GetVert(mesh->GetFace(i)->GetVert(j)).y, mesh->GetVert(mesh->GetFace(i)->GetVert(j)).z);
}
glEnd();
}else{
glBegin(GL_QUADS);
for (unsigned int j=0; j<4; ++j){
glTexCoord2f( mesh->GetTexVert(mesh->GetFace(i)->GetTexVert(j)).x, mesh->GetTexVert(mesh->GetFace(i)->GetTexVert(j)).y);
glVertex3f( mesh->GetVert(mesh->GetFace(i)->GetVert(j)).x, mesh->GetVert(mesh->GetFace(i)->GetVert(j)).y, mesh->GetVert(mesh->GetFace(i)->GetVert(j)).z);
}
glEnd();
}
}
}
std::vector<DisplayedBeing3D*> c = mesh->GetChildren();
for (unsigned int i=1; i < c.size();i++){
BufferObject(c[i]);
}
}