Some problems in our turtle!

Hi there
Our modeller has designed a turtle character with 3DMax. I have rendered it with OpenGL. However it has some problems.Let’s start step by step…
Here’s an screenshot of the turtle rendered with 3DMax:

And here’s the character rendered with our engine:

http://zehneziba.ir/screenshot/LAKI/ZehneZiba%202006-08-27%2020-04-02-03.jpg

As you see, the polygons of his face look bad.

1)why the image rendered with 3DMax is different by the rendered image in my program?

2)Should we add more polygons to our model? This model has about 1300 vertices.(Can we solve the problem without adding the new vertices? )
3)Can i improve the lighting calculations in my program?
4)take a look at his neck:

http://zehneziba.ir/screenshot/LAKI/ZehneZiba%202006-08-27%2017-53-01-37.jpg

Yes.Noone like to see such neck in a game.So how can i improve the shape of this neck?( Can i do anything with OpenGL to improve the quality of the neck? )

5)How many vertices can we use for this turtle to have a good looking character?
Regards
-Ehsan-

It is possible that something happened to the vertex normals in the process of getting them into your program. They may have incorrect directions or they are smoothed incorrectly (or using different set of triangles for smoothing than the 3dmax uses).

It looks like maybe you’ve got some normals out of whack. Have you tried recalculating your mesh normals?

More triangles can help make things smoother, sure, but you may not need them. I’d fix those normals first. The reason I say normals is because the shading looks wrong.

Edit:

Double post! What Komat said :slight_smile:

Thank you.Actually when my colleague selected the “Unify Normals” instead of the “Flip Normals”, the image rendered with 3DMax was the same as the scene rendered with my program…
I wrote another question in gamedev.net, since this topic refers to the 3DMax software :
http://www.gamedev.net/community/forums/topic.asp?topic_id=411644
-Ehsan-

3ds max usually uses special face smoothing mechanisms (where each face sharing the same smoothing bit appear smooth), while OpenGL uses per-vertex normals. I think this can be your problem. How do you calculate normals? Probably you should add more faces…

HiOne problem reffers to the normal vectors. Actually exporting the normal vectors to the 3DS file format was changing the direction of some normals( My code is correct ).
As you said , OpenGL lighting calculations are per vertex. So i guess that he should generate more polygons.
I don’t calculate the normal vectors. I read them from the 3DS file.
-Ehsan-

3ds files don’t store normals.

I wrote a 3ds loader several years ago and I can remember dealing with smoothing groups and calculating the normals myself. The models I loaded looked good. I don’t have the code anymore and can’t remember the details though.

That’s the way I remember it as well. You need to (re)calculate the normals yourself, using the triangle vertices and the optional smoothing groups. The is no NORMAL chunk, or the like, as I recall. Though I hasten to point out that it’s been a while.

Actually i load the ms3D models.However we need to create our models in 3Ds Max and import them to milkshape3D. So i need a common importer/exporter in both the softwares.Are you aware of a good file format that doesn’t crash the normal data?
Does such format use the “unit” normal vectors?
-Ehsan-

It’s either surface normals being incorrectly calculated or differently smoothed between rendering paths. The idea is that normals are shared and averaged at a vertex under some control or angle threshold. You need to adjust this or as you have understood, preserve normals throughout the export & rendering process.

Originally posted by <pfft>:
3ds files don’t store normals.
It’s clear that 3DS file format does not suppro normal vectors. But i think that 3Ds Max Have written a function to add normal vectors to the 3DS file. When i open the 3DS file and select the edit normal modifier, i can see the normal vectors.
-Ehsan-

Originally posted by Ehsan Kamrani:
Actually i load the ms3D models.However we need to create our models in 3Ds Max and import them to milkshape3D. So i need a common importer/exporter in both the softwares.Are you aware of a good file format that doesn’t crash the normal data?

One format supported by both the 3DSMax (at least trough the plugin) and MilkShape3D should be the “.x” DirectX format. That format also contains vertex normals.

Originally posted by Ehsan Kamrani:
[quote]Originally posted by <pfft>:
3ds files don’t store normals.
It’s clear that 3DS file format does not suppro normal vectors. But i think that 3Ds Max Have written a function to add normal vectors to the 3DS file. When i open the 3DS file and select the edit normal modifier, i can see the normal vectors.
-Ehsan-
[/QUOTE]You mean you import a 3ds file into milkshape and then modify normals?

Originally posted by Ehsan Kamrani:
I don’t calculate the normal vectors. I read them from the 3DS file.
-Ehsan-

I’m really confused by your posts, Ehsan Kamrani.

[/QUOTE]You mean you import a 3ds file into milkshape and then modify normals?[/QUOTE]

Yes.However i don’t compute/edit normals.In my implementation of 3DSMAX(version 7 ), 3DS file consist of the normal vectors.As i said before, i guess the 3dmax programmers have added a function to compute the normal vectors.
Note : i don’t know why message board has some errors in my browser(Mozilla Firefox).
-Ehsan-

Originally posted by Ehsan Kamrani:
But i think that 3Ds Max Have written a function to add normal vectors to the 3DS file. When i open the 3DS file and select the edit normal modifier, i can see the normal vectors.

The normal vectors you see are not stored within the 3DS file itself. When 3DS Max loads the file, it calculates the normals from vertex positions and additional informations stored inside the file. If another program uses different calculations (or interprets the data differently), it may get different normals.

As you know, OpenGL lighting is per polygon. It causes some problems in our game. Take a look at our turtle as an example:

You can see the boundries of the polygons when lighting is enabled. So how can i solve this problem? I use frm cal3D, so i’m sure that normal vectors are imported with no errors. Note that the length of each normal is equal 1.
-Ehsan-

Ehsan,
Take a look at the per-pixel lighting using GLSL.
Here is a good tutorial:
http://www.lighthouse3d.com/opengl/glsl/index.php?dirlightpix

You can see the difference between per-pixel and per-vertex lighting at the bottom of the page.

Do you mean the shape of the turtle (those bad hard line links) ? I would advise to make a turtle with more polygons and also ensuring that normals aren’t all the same for a given polygon (so with using per vertex normals).

This might give best results.