Files |  Tutorials |  Articles |  Links |  Home |  Team |  Forum |  Wiki |  Impressum

Aktuelle Zeit: Di Jul 15, 2025 11:17

Foren-Übersicht » Sonstiges » Meinungen zu den Projekten
Unbeantwortete Themen | Aktive Themen



Ein neues Thema erstellen Auf das Thema antworten  [ 103 Beiträge ]  Gehe zu Seite Vorherige  1, 2, 3, 4, 5 ... 7  Nächste
Autor Nachricht
 Betreff des Beitrags:
BeitragVerfasst: Mo Mär 15, 2004 17:57 
Offline
DGL Member
Benutzeravatar

Registriert: Fr Dez 13, 2002 12:18
Beiträge: 1063
You could send a relative path to your textures (such as textures\mytex.jpg instead of c:\bla\blubb\myprojects\delphi\megaman\textures\mytex.jpg).
If you have to send absolute paths, you can derive them from the starting folder of your application by using ParamStr(0) and concatenating your file names.

_________________
Viel Spaß beim Programmieren,
Mars
http://www.basegraph.com/


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: Mo Mär 15, 2004 18:26 
Offline
Guitar Hero
Benutzeravatar

Registriert: Do Sep 25, 2003 15:56
Beiträge: 7810
Wohnort: Sachsen - ERZ / C
Programmiersprache: Java (, Pascal)
Where can I set the texture-Path?? The best way would be, saving the Textures in .3DS . But...
It would be cool if there was a property like:
TAll3DSMesh.texturepath
So it would be possible to set an explicite searchpath for every Mesh...

_________________
Blog: kevin-fleischer.de und fbaingermany.com


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: Mo Mär 15, 2004 18:30 
Offline
DGL Member
Benutzeravatar

Registriert: Mo Okt 27, 2003 17:46
Beiträge: 788
modell := TAll3dsMesh.Create(self);
modell.TexturePath := 'models\';
modell.LoadFromFile('models\hinterachse.3ds');

And all (läuft?! kann ja schlecht sagen goes oder?) is good ^^


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: Mo Mär 15, 2004 18:53 
Offline
DGL Member
Benutzeravatar

Registriert: Fr Dez 13, 2002 12:18
Beiträge: 1063
and everything works :wink:

_________________
Viel Spaß beim Programmieren,
Mars
http://www.basegraph.com/


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: Mo Mär 15, 2004 19:00 
Offline
Guitar Hero
Benutzeravatar

Registriert: Do Sep 25, 2003 15:56
Beiträge: 7810
Wohnort: Sachsen - ERZ / C
Programmiersprache: Java (, Pascal)
I think i have an idea, why my code don' work... What must I write by tAll3DSMesh(-?????-). If I whant to use "self" there...where have I to do this (in which procedure?)?

PS: Ohhhhhh real brute force english.... 8)

_________________
Blog: kevin-fleischer.de und fbaingermany.com


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: Mo Mär 15, 2004 19:04 
Offline
DGL Member
Benutzeravatar

Registriert: Mo Sep 23, 2002 19:27
Beiträge: 5812
Programmiersprache: C++
Just use NIL.

_________________
www.SaschaWillems.de | GitHub | Twitter | GPU Datenbanken (Vulkan, GL, GLES)


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: Do Mär 25, 2004 12:22 
Offline
DGL Member
Benutzeravatar

Registriert: Mo Sep 23, 2002 19:27
Beiträge: 5812
Programmiersprache: C++
I think I've found another bug. When you mirror an object, it isn't rendered correct anymore with your loader. Although better than Lischke's loader, that didn't render mirrored objects at all, your loader seems to mirror the object wrongly (didn't yet took a look at the source where mirroring is taken into account).
Take a look at this small model I put together, left is how it looks rendered with gl3Ds.pas and right shows it in 3DS :

Bild Bild

It seems that the right half of the brain is also (wrongly) mirrored on the Z-axis. But I don't know how 3DS stores mirrored vertices when exporting to .3DS, so it may be a fault within 3DS-export itself.

_________________
www.SaschaWillems.de | GitHub | Twitter | GPU Datenbanken (Vulkan, GL, GLES)


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: Fr Mär 26, 2004 14:23 
Offline
Guitar Hero
Benutzeravatar

Registriert: Do Sep 25, 2003 15:56
Beiträge: 7810
Wohnort: Sachsen - ERZ / C
Programmiersprache: Java (, Pascal)
I have two neg. points to say.

1. You need so many librarys for your library! I think it would be coul, if you put all those Functions you need (from any library you use) in one library (gl3DS_helpers). This would even be an advantage when your library is spread over the whole inet.

2. It don't work! Ok, I think it's not a real problem, but i put your library to my uses part and tried to compile. I get 3 Faults. Always "Not enough Parameters". All those Errors depend to Loadtexture(); . This Function needs 3 Parameters, but you give only 2. As I see, you forget to give a Boolean-var to the Function. So what should I write in there? A Boolean with a Value of true or false?

PS: The Error occoure in Line 2232, 2234 and 2450.

_________________
Blog: kevin-fleischer.de und fbaingermany.com


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: Sa Mär 27, 2004 11:31 
Offline
DGL Member
Benutzeravatar

Registriert: Di Jul 01, 2003 18:59
Beiträge: 887
Wohnort: (The Netherlands)
Programmiersprache: fpc/delphi/java/c#
Thanks for all the feedback.

Some short answers:
-I was not aware of mirrored 3ds meshes.
-The texture part is a work in progres and i changed the texture unit recently and i will do that again. I must have missed some calls to it.
-with create just use nil. Or if you use a form use the form there that way on closing the form the mesh will be destroyed also.
- 3DS files dont store paths to textures, they just store the texture filename (as far as i know). 3D apps search the textures on texture paths e.g. pointing to texture libraries. That is what the texturepath property is for. You better set the texturepath on tall3dsmesh even if the textures are in the same dir as where the 3ds file is. On loading the 3ds files all texture files should be loaded automaticaly.
-I am using many units for now, once i am happy with things that will be replaced. But not for now.
-Try using a tlist structure in stead of an array. Do use new(mesh) where mesh is a PAll3DSMesh structure.
-Do test the 3ds mesh loading directly into a tall3dsmesh directly if it is not working if it does not work there either that 3ds mesh is not supported yet.

I hope this answers some questions.

Keep up sending feedback, i need it.

_________________
http://3das.noeska.com - create adventure games without programming


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: Fr Jun 04, 2004 13:51 
Offline
DGL Member
Benutzeravatar

Registriert: Mo Sep 23, 2002 19:27
Beiträge: 5812
Programmiersprache: C++
I'm right now working on a gameproject where I use fairly complex scenery and on of the scenes I'm using shows a prehistorical forestscene. And for the foliage of the trees, I'm using planes but since planes in 3DS only have one side, parts of them get culled as soon as you enable back-face culling (which is a must cause it gains you a good amount of performance) so that the foliage isn't displayed correctly :

Bild Bild
(Left : No two-sided materials, Right : Correct display with two-sided materials)

To get around this, you need to load a chunk called MAT_TWO_SIDED that contains nothing, but if it's present for a material, it's a two-sided material. If you have such a material, you'll just have to turn back-face-culling off :

MAT_TWO_SIDED :
This is very usefull if you're using backface culling (which gives you a nice performanceboost) and use planes for things like foliage. Since those planes normally would get backfaceculled some parts may not be visible and that may lead to a wrong display of things like trees and so on. So you just need to say 3DS that the material for such things is two-sided and then disable culling for all faces using that material.

Loading :
Code:
  1.          MAT_TWO_SIDE : begin
  2.                         // This chunk contains nothing but the header. If it's present,
  3.                         // the current material is two-sided and won't get backface-culled
  4.                         _Material[mcount-1].TwoSided := True;
  5.                         end;


Applying :
Code:
  1.  if TwoSided then
  2.   glDisable(GL_CULL_FACE)
  3.  else
  4.   glEnable(GL_CULL_FACE);
  5.  



P.S. : To get two-sided materials in 3DS, you'll have to check this in the material editor :
Bild

_________________
www.SaschaWillems.de | GitHub | Twitter | GPU Datenbanken (Vulkan, GL, GLES)


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: Fr Jun 04, 2004 17:28 
Offline
DGL Member
Benutzeravatar

Registriert: Di Jul 01, 2003 18:59
Beiträge: 887
Wohnort: (The Netherlands)
Programmiersprache: fpc/delphi/java/c#
nice :-)

It goes in the next release.

To make it easy for me: What is the hex number for: MAT_TWO_SIDED

_________________
http://3das.noeska.com - create adventure games without programming


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: Fr Jun 04, 2004 17:31 
Offline
DGL Member
Benutzeravatar

Registriert: Mo Sep 23, 2002 19:27
Beiträge: 5812
Programmiersprache: C++
Ah sorry, here is the ID the corresponding chunk :
Code:
  1. MAT_TWO_SIDE     = $A081;

_________________
www.SaschaWillems.de | GitHub | Twitter | GPU Datenbanken (Vulkan, GL, GLES)


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: Mi Jun 23, 2004 21:43 
Offline
DGL Member
Benutzeravatar

Registriert: Mo Sep 23, 2002 19:27
Beiträge: 5812
Programmiersprache: C++
I was just building a scenery for my current project, where I had some transparent objects in, and since your gl3DS now just draws mesh after mesh, I got some problems with that : Just create an object that's transparent and create a second object in it that's not transparent. Since your unit draws mesh 0 first, you'll only see the transparent object (cause you have to do sorting for transparent objects).

So I enhanched the loader so that it first draws all non-transparent objects and then at last the transparent objects. So that transparency works in most cases (as long as there aren't two transparent objects overlapping).
First thing I do now is to check if a mesh has at least one face that has a transparent material assigned, to make it easy, I do this in the calcvnormals-procedure as that get's called after all meshes are loaded and therefore is the best place for that :
Code:
  1. for m:=0 to _NumMeshes-1 do
  2.  begin
  3.  ...
  4.   with _Mesh[m] do
  5.    begin
  6.    f := 0;
  7.    _hastranspfaces := False;
  8.    while f < _numindices-1 do
  9.     begin
  10.     if MatID[f div 3] in [Low(_Material)..High(_Material)] then
  11.      if _Material[MatID[f div 3]]._transparency < 1 then
  12.       begin
  13.       _hastranspfaces := True;
  14.       break;
  15.       end;
  16.     inc(f,3);
  17.     end;
  18.    end;
  19.   end;
  20.   ...


After that it's easy to render all transparent objects last \";)\" :
Code:
  1. procedure TAll3DSMesh.render;
  2. var
  3.  m: longword;
  4. begin
  5.  // Nicht transparente Meshes zuerst
  6.  for m := 0 to _NumMeshes-1 do
  7.   if not _Mesh[m]._hastranspfaces then
  8.    _Mesh[m].UseTangents := UseTangents;
  9.  // Am Schluss transparente Meshes
  10.  for m := 0 to _NumMeshes-1 do
  11.   if _Mesh[m]._hastranspfaces then
  12.    _Mesh[m].render;
  13. end;


It's an easy to implement feature, but especially in scenes that have transparent objects in them, it's necessary.

_________________
www.SaschaWillems.de | GitHub | Twitter | GPU Datenbanken (Vulkan, GL, GLES)


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: Fr Jun 25, 2004 23:26 
Offline
DGL Member
Benutzeravatar

Registriert: Di Jul 01, 2003 18:59
Beiträge: 887
Wohnort: (The Netherlands)
Programmiersprache: fpc/delphi/java/c#
the latest versions should render transparent meshes correctly already. I have a look at your code and see if it is better...

_________________
http://3das.noeska.com - create adventure games without programming


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: Mo Jun 28, 2004 19:17 
Offline
Guitar Hero
Benutzeravatar

Registriert: Do Sep 25, 2003 15:56
Beiträge: 7810
Wohnort: Sachsen - ERZ / C
Programmiersprache: Java (, Pascal)
I've downloaded Version 2.4a from your homepage.
Is it posible that you packed a wrong Version of the Logger.pas to the Zip?
The Compiler don't know a methode named "Writeln()" (line 337 / .LoadTexture()).
Its no great thing to fix it myself but, its bether you know about it.

_________________
Blog: kevin-fleischer.de und fbaingermany.com


Nach oben
 Profil  
Mit Zitat antworten  
Beiträge der letzten Zeit anzeigen:  Sortiere nach  
Ein neues Thema erstellen Auf das Thema antworten  [ 103 Beiträge ]  Gehe zu Seite Vorherige  1, 2, 3, 4, 5 ... 7  Nächste
Foren-Übersicht » Sonstiges » Meinungen zu den Projekten


Wer ist online?

Mitglieder in diesem Forum: 0 Mitglieder und 3 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.

Suche nach:
Gehe zu:  
  Powered by phpBB® Forum Software © phpBB Group
Deutsche Übersetzung durch phpBB.de
[ Time : 0.012s | 15 Queries | GZIP : On ]