Registriert: Sa Aug 18, 2007 18:47 Beiträge: 694 Wohnort: Köln
Programmiersprache: Java
btw: is there a way to prevent calculation of vertexnormals?
e.g. use only face normal?
ok facenormal only does make sense when there are just triangles used.
edit: ehm, may be i'm wrong, but does it really calculate vertex normals? as far as i understand the source code it seams it just calculates the face normals...
_________________ Es werde Licht. glEnable(GL_LIGHTING); Und es ward Licht.
Zitat aus einem Java Buch: "C makes it easy to shoot yourself in the foot; C++ makes it harder, but when you do it blows your whole leg off"
Registriert: Sa Aug 18, 2007 18:47 Beiträge: 694 Wohnort: Köln
Programmiersprache: Java
im trying to build a kind of tilebased game. i put some tiles into one 3ds file and access them through the mesh number. rendering works well.
tiles are arranged as desired.
tiles are nearly equivalent to cubes. means: same plane on upper side.
so in result some quads are rendered just side by side, giving a rectangular plane.
prob is now, that normals are totally messed when enlighted by standard opengl light.
i tried to comment calcvnormals() out, but i get an access violation o.O
_________________ Es werde Licht. glEnable(GL_LIGHTING); Und es ward Licht.
Zitat aus einem Java Buch: "C makes it easy to shoot yourself in the foot; C++ makes it harder, but when you do it blows your whole leg off"
Registriert: Do Sep 25, 2003 15:56 Beiträge: 7804 Wohnort: Sachsen - ERZ / C
Programmiersprache: Java (, Pascal)
@glModel (Nameswitch):
Ich verstehe deine Idee, hinter der Namensänderung. Allerdings ist das schon ein ganz schon schwerer Schnitt, schließlich kann man "gl3ds" schon fast als Markenname sehen. Du solltest den neuen Namen sehr gut promoten, und darauf hinweisen, dass der Loader bereits seit 2003(?) gepflegt wird.
_________________ Blog: kevin-fleischer.de und fbaingermany.com
Registriert: Do Sep 02, 2004 19:42 Beiträge: 4158
Programmiersprache: FreePascal, C++
Du solltest vielleicht schreiben "glModel (earlier gl3ds)", sodass die leute das Produkt wiedererkennen.
Aber: Weiter so. Ein umfangreicher, flexibler Modelloader für verschiedene Formate hat natürlich was.
Gruß Lord Horazont
_________________ If you find any deadlinks, please send me a notification – Wenn du tote Links findest, sende mir eine Benachrichtigung. current projects: ManiacLab; aioxmpp zombofant network • my photostream „Writing code is like writing poetry“ - source unknown
„Give a man a fish, and you feed him for a day. Teach a man to fish and you feed him for a lifetime. “ ~ A Chinese Proverb
Registriert: Do Sep 02, 2004 19:42 Beiträge: 4158
Programmiersprache: FreePascal, C++
Hm, ich hätte jetzt eher an den Garfield 2-Film gedacht
Aber lassen wir das...
Gruß Lord Horazont
_________________ If you find any deadlinks, please send me a notification – Wenn du tote Links findest, sende mir eine Benachrichtigung. current projects: ManiacLab; aioxmpp zombofant network • my photostream „Writing code is like writing poetry“ - source unknown
„Give a man a fish, and you feed him for a day. Teach a man to fish and you feed him for a lifetime. “ ~ A Chinese Proverb
scene1.Models[1].Mesh[0].NumNormals:=12; //for each face indices div 3
scene1.Models[1].Mesh[0].NumNormalIndices:=36;
scene1.Models[1].CalcVnormals;
//add fake texture coords
scene1.Models[1].Mesh[0].NumMappings:=1;
scene1.Models[1].Mesh[0].NumMappingIndices:=36;
map.tu:=0;
map.tv:=0;
scene1.Models[1].Mesh[0].Mapping[0]:=map;
for tel:=0 to 35 do
begin
scene1.Models[1].Mesh[0].Map[tel]:=0;
end;
//make mesh visible
scene1.Models[1].Mesh[0].Visible:=true;
//calculate size for bounding box
scene1.Models[1].CalculateSize;
//determine render order even with one mesh
scene1.Models[1].CalculateRenderOrder;
//save test
scene1.Models[1].SaveToFile('test.obj');
Now this should be more 'programmer' friendly. So feedback is appreciated.
nb: the scene1.Model[1] is one because it is the second model in my test application.
Also normals calculation is once again in a rewrite cycle so you could expect a new release of glModel after some more testing. The new calculation method breaks current loaders that use it.
i actually appreciate to hear that .. the normals are calculated quite strangely in some spots in my current project and i hope that might change after a rewrite .. but at all .. good thing ^^
it nearly works. I can see my meshes but they're all green (I did not use textures, I only changed the materials).
What do I wrong?
Edit: I noticed that my spaceship gets the color that I set with glcolor3f in a for-loop between another glpushmatrix and glpopmatrix... . If I don't set that color, everything is white.
OK, this problem ist solved now (disabled gl_color_material), but if I now load a 3ds with texture, I get this error message: "TglBitmap.LoadFromStream - Couldn't load Stream. It's possible to be an unknow Streamtype."
I get this both with bmps and jpgs.
Registriert: Di Jul 01, 2003 18:59 Beiträge: 887 Wohnort: (The Netherlands)
Programmiersprache: fpc/delphi/java/c#
There is new release for glmodel. Now it is at version 3.5a bringing a new vbo render target. You can get i from svn or download it as an zip file from: http://www.noeska.net/downloads/glModel-3.5.0a.zip .
Mitglieder in diesem Forum: 0 Mitglieder und 18 Gäste
Du darfst keine neuen Themen in diesem Forum erstellen. Du darfst keine Antworten zu Themen in diesem Forum erstellen. Du darfst deine Beiträge in diesem Forum nicht ändern. Du darfst deine Beiträge in diesem Forum nicht löschen. Du darfst keine Dateianhänge in diesem Forum erstellen.