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

Aktuelle Zeit: Sa Jul 19, 2025 21:10

Foren-Übersicht » Programmierung » Einsteiger-Fragen
Unbeantwortete Themen | Aktive Themen



Ein neues Thema erstellen Auf das Thema antworten  [ 31 Beiträge ]  Gehe zu Seite Vorherige  1, 2, 3  Nächste
Autor Nachricht
 Betreff des Beitrags:
BeitragVerfasst: Sa Okt 24, 2009 20:11 
Offline
DGL Member
Benutzeravatar

Registriert: Fr Okt 23, 2009 12:22
Beiträge: 26
Programmiersprache: Delphi(, C++)
I think the previous problem was in the glBitmap.pas.

Anyway, I've tried it again with
Code:
  1.  
  2. var Model1: TGlModel;
  3. ...
  4. model1 := TGlModel.Create(nil);
  5. model1.LoadFromFile(extractfilepath(paramstr(0))+'3ds\spaceship.3ds');
  6. model1.TexturePath := extractfilepath(paramstr(0))+'tex';
  7. ...
  8. model1.Render;
  9.  

... and I get the Access Violation again :( (This time also without textures!)[/code]


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: Sa Okt 24, 2009 20:51 
Offline
DGL Member
Benutzeravatar

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

Code:
  1.  
  2. //in the uses
  3.   glRender,
  4.   Model,
  5.   Model3ds,
  6.   ModelObj,
  7.   ModelX,
  8.   ModelMsa;
  9.  
  10. //in the var section
  11. scene1: TglRender;
  12.  
  13. //in the init part of your application
  14. scene1 := TglRender.Create(nil);
  15. scene1.AddModel();
  16. scene1.Models[0].LoadFromFile(extractfilepath(paramstr(0))+'3ds\spaceship.3ds');
  17. scene1.Models[0].TexturePath:=extractfilepath(paramstr(0))+'tex';
  18. scene1.UpdateTextures;
  19.  
  20. //in the render part of your application
  21. scene1.Models[0].Render;
  22.  

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


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: Sa Okt 24, 2009 21:10 
Offline
DGL Member
Benutzeravatar

Registriert: Fr Okt 23, 2009 12:22
Beiträge: 26
Programmiersprache: Delphi(, C++)
Thanks for your help!
Unfortunately, I cannot see the loaded model - only the rest of my scene.
As said before, it worked with gl3ds except the textures and because of that I don't think that the model is too small or at a wrong position...

Code:
  1.  
  2.   model1.Models[0].LoadFromFile(extractfilepath(paramstr(0))+'3ds\spaceship.3ds');
  3.   model1.Models[0].TexturePath:=extractfilepath(paramstr(0))+'tex';
  4.   model1.UpdateTextures;
  5.   showmessage(model1.Models[0].GetNamePath);
  6.  

When I launch my application, the messagebox is empty :(
Is this again the problem with Char,AnsiChar etc. in D2009?


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: Sa Okt 24, 2009 22:11 
Offline
DGL Member
Benutzeravatar

Registriert: Di Jul 01, 2003 18:59
Beiträge: 887
Wohnort: (The Netherlands)
Programmiersprache: fpc/delphi/java/c#
It should work in delphi2009.
But i do not know .GetNamePath
Try using .Path or .TexturePath

Are you willing to send me the 3ds mesh so i can test it?

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


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: Sa Okt 24, 2009 22:29 
Offline
DGL Member
Benutzeravatar

Registriert: Fr Okt 23, 2009 12:22
Beiträge: 26
Programmiersprache: Delphi(, C++)
Same thing with .path

I attached the 3ds now.
And thanks again for your patience ;)


Du hast keine ausreichende Berechtigung, um die Dateianhänge dieses Beitrags anzusehen.


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: Sa Okt 24, 2009 23:09 
Offline
DGL Member
Benutzeravatar

Registriert: Di Jul 01, 2003 18:59
Beiträge: 887
Wohnort: (The Netherlands)
Programmiersprache: fpc/delphi/java/c#
Ok with your .3ds file i also get an empty scene. Saving it to .txt or .obj with glModel and loading these instead give some nice error's. So somehow glModel is having problems reading your .3ds file properly.
What modelling software did you use making the .3ds file?

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


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: Sa Okt 24, 2009 23:15 
Offline
DGL Member
Benutzeravatar

Registriert: Fr Okt 23, 2009 12:22
Beiträge: 26
Programmiersprache: Delphi(, C++)
Anim8or

But why did it work with gl3ds? Is there a better possibility to export anim8or-models to 3ds, maybe with Blender somehow?


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: So Okt 25, 2009 00:00 
Offline
DGL Member
Benutzeravatar

Registriert: Di Jul 01, 2003 18:59
Beiträge: 887
Wohnort: (The Netherlands)
Programmiersprache: fpc/delphi/java/c#
Anim8or should be fine, i have not used it for a while. I will investigate why it does not work with glModel.
Also try exporting your model as .obj from Anim8or and load that one.

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


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: So Okt 25, 2009 10:24 
Offline
DGL Member
Benutzeravatar

Registriert: Fr Okt 23, 2009 12:22
Beiträge: 26
Programmiersprache: Delphi(, C++)
:? As obj: "0.533 ist kein gültiger Gleitkommawert" (-> is no valid real value?). It is always the same number, even if I convert another model...


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: So Okt 25, 2009 11:22 
Offline
DGL Member
Benutzeravatar

Registriert: Di Jul 01, 2003 18:59
Beiträge: 887
Wohnort: (The Netherlands)
Programmiersprache: fpc/delphi/java/c#
Oh you need to set the following in your application to make that work:
DecimalSeparator:='.'; //always use . as decimal seperator if it is , for dutch language!
I guess only people with english or american country/language settings get away without setting that line.

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


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: So Okt 25, 2009 12:31 
Offline
DGL Member
Benutzeravatar

Registriert: Di Jul 01, 2003 18:59
Beiträge: 887
Wohnort: (The Netherlands)
Programmiersprache: fpc/delphi/java/c#
Found the real problem now. When loading the 3DS file the visibility is read from TRI_VISIBLE and this is either read wrong in my code or set wrong in 3ds file.

You can solve this by setting:
Code:
  1. scene1.Models[0].Mesh[0].Visible := true;


And give the default material a somewhat nicer color ...
Code:
  1. scene1.Models[0].Material[0].DiffuseRed:= 0.0;
  2. scene1.Models[0].Material[0].DiffuseBlue:= 1.0; //make it blue
  3. scene1.Models[0].Material[0].DiffuseGreen:= 0.0;
  4. scene1.Models[0].Material[0].AmbientRed:= 0.5; //make it red'ish
  5. scene1.Models[0].Material[0].IsAmbient:=true;
  6. scene1.Models[0].Material[0].Name:='BlueMat';
  7. scene1.Models[0].Mesh[0].MatName[0]:=scene1.Models[0].Material[0].Name;
  8. scene1.Models[0].Mesh[0].MatID[0]:=0; //first material in model


Also .obj files written by Anim8or give some problems with glModel as the G tag is not where i expect it to be.

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


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: So Okt 25, 2009 13:06 
Offline
DGL Member
Benutzeravatar

Registriert: Fr Okt 23, 2009 12:22
Beiträge: 26
Programmiersprache: Delphi(, C++)
Thank you very much, this works! :)
Unfortunately, it doesn't load the materials, but for this project it is not too much to set them manually.
Also the 2nd Object in my model isn't loaded. I will export this to another 3ds and load them both to solve it ;)


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: So Okt 25, 2009 13:43 
Offline
DGL Member
Benutzeravatar

Registriert: Di Jul 01, 2003 18:59
Beiträge: 887
Wohnort: (The Netherlands)
Programmiersprache: fpc/delphi/java/c#
if you have 2 meshes/objects in your 3ds file you also have to:
Code:
  1. scene1.Models[0].Mesh[0].Visible := true;
  2. scene1.Models[0].Mesh[1].Visible := true;

So each mesh/object needs to have its visibility set to true.

But if i understand correctly if you set an material in anim8or to an mesh/object it does not show up? I will do some experiments this evening ...

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


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: So Okt 25, 2009 14:05 
Offline
DGL Member
Benutzeravatar

Registriert: Fr Okt 23, 2009 12:22
Beiträge: 26
Programmiersprache: Delphi(, C++)
ah, right. my fault :oops: :)

Zitat:
i have not used it for a while

do you already have the newest version?
Zitat:
The fourth v0.97 preview is called the v0.97d preview dated September 21, 2008.

:arrow: http://anim8or.com

Sorry, my model has material! Now as I enabled the second mesh I can see the yellow color of the windows. Probably there's something wrong with my lights...


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: So Okt 25, 2009 17:30 
Offline
DGL Member
Benutzeravatar

Registriert: Di Jul 01, 2003 18:59
Beiträge: 887
Wohnort: (The Netherlands)
Programmiersprache: fpc/delphi/java/c#
Considering materials and lighting read this: http://wiki.delphigl.com/index.php/Beleuchtung
so the light settings and positions and the materials settings together make how a material/color looks like.

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


Nach oben
 Profil  
Mit Zitat antworten  
Beiträge der letzten Zeit anzeigen:  Sortiere nach  
Ein neues Thema erstellen Auf das Thema antworten  [ 31 Beiträge ]  Gehe zu Seite Vorherige  1, 2, 3  Nächste
Foren-Übersicht » Programmierung » Einsteiger-Fragen


Wer ist online?

Mitglieder in diesem Forum: 0 Mitglieder und 7 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:  
cron
  Powered by phpBB® Forum Software © phpBB Group
Deutsche Übersetzung durch phpBB.de
[ Time : 0.011s | 14 Queries | GZIP : On ]