Autor Beitrag
Sal-9000
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 30



BeitragVerfasst: Do 17.07.08 15:19 
Hi

Hat hier evtl schon mal jemand ein 3dsmax-model in delphi integriert oder weis, wie man das macht?

Hab mir nen Würfel gebastelt (ich weiß, noob-kram) den ich jetzt mittels Delphi in eine exe einbinden will, in der ich den Würfel mittels Achsensteuerung drehen kann!

Ich hab noch keine Ahnung von 3d, ist quasie ein Lern-projekt! Wäre echt klasse, wenn zur ausname mal keine "schminks dir ab-Antworten" kommen würden, sondern am allerbesten links zu tuturials und/oder einem Bsp-Projekt, das ich mir in ruhe anschauen kann!

Wichtig is nur, das ich den Würfel aus 3dsmax importieren kann und mir keinen mittels OpenGl basteln muss!

Wie gesagt, am besten ein Beispiel-Projekt, das eben die von mir genannten Fähigkeiten besitzt!

SAL-9000
mkinzler
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 4106
Erhaltene Danke: 13


Delphi 2010 Pro; Delphi.Prism 2011 pro
BeitragVerfasst: Do 17.07.08 15:24 
.3ds oder .max? Schau dir mal GLScene an, da ist für 2. eine Klasse dabei

_________________
Markus Kinzler.
Sal-9000 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 30



BeitragVerfasst: Do 17.07.08 15:41 
Hi

is ne ".max" file! Gibt irgendwo n Bsp-Project das mit ".max" Arbeitet bzw eins, das mir die
Funktion der klasse in GLScene erklärt? Wie gesagt, noob ;-) !
F34r0fTh3D4rk
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 5285
Erhaltene Danke: 29

Win Vista (32), Win 7 (64)
Eclipse, SciTE, Lazarus
BeitragVerfasst: Sa 19.07.08 13:01 
Wenn du die Möglichkeit hast, als .3ds zu exportieren, dürfte das hier interessant sein:

www.martinreddy.net/gfx/3d/3DS.spec

mf
turboPASCAL
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 193
Erhaltene Danke: 1

Win XP / Vischda
D6 PE / D2005 PE
BeitragVerfasst: Mo 21.07.08 17:57 
Also, mit einer 3dsMax Datei (.max) wird das nix.
Du kannst uner 3dsMax verschiedene Exportformate wählen zB.: .3ds oder .obj, dies sind einfachere Modelldateien.
Im Internet gibt es zu diesen Formaten mehrere "Importer" bzw. Units mit den man gut arbeiten kann.


Zitat:
Wichtig is nur, das ich den Würfel aus 3dsmax importieren kann und mir keinen mittels OpenGl basteln muss!


wieso, ist einfach'st...

ausblenden volle Höhe Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
procedure glDrawQader();
begin
  glColor4f(1.0, 1.0, 1.0, 1.0);
  glBindTexture(GL_TEXTURE_2D, Texture[TEX_SB_TOP]);  // Bind the Texture to the object
  glBegin(GL_QUADS);
    // Top Face
    glNormal3f( 0.0, 1.0, 0.0);
    glTexCoord2f(0.0, 1.0); glVertex3f(-1.0,  1.0, -1.0);
    glTexCoord2f(0.0, 0.0); glVertex3f(-1.0,  1.0,  1.0);
    glTexCoord2f(1.0, 0.0); glVertex3f( 1.0,  1.0,  1.0);
    glTexCoord2f(1.0, 1.0); glVertex3f( 1.0,  1.0, -1.0);
  glEnd;

  glBindTexture(GL_TEXTURE_2D, Texture[TEX_SB_SIDE]);  // Bind the Texture to the object
  glBegin(GL_QUADS);
    // Front Face
    glNormal3f( 0.0, 0.0, 1.0);
    glTexCoord2f(0.01, 0.01); glVertex3f(-1.0, -1.0,  1.0);
    glTexCoord2f(0.99, 0.01); glVertex3f( 1.0, -1.0,  1.0);
    glTexCoord2f(0.99, 0.99); glVertex3f( 1.0,  1.0,  1.0);
    glTexCoord2f(0.01, 0.99); glVertex3f(-1.0,  1.0,  1.0);
    // Back Face
    glNormal3f( 0.0, 0.0,-1.0);
    glTexCoord2f(0.99, 0.01); glVertex3f(-1.0, -1.0, -1.0);
    glTexCoord2f(0.99, 0.99); glVertex3f(-1.0,  1.0, -1.0);
    glTexCoord2f(0.01, 0.99); glVertex3f( 1.0,  1.0, -1.0);
    glTexCoord2f(0.01, 0.01); glVertex3f( 1.0, -1.0, -1.0);
    // Right face
    glNormal3f( 1.0, 0.0, 0.0);
    glTexCoord2f(0.99, 0.01); glVertex3f( 1.0, -1.0, -1.0);
    glTexCoord2f(0.99, 0.99); glVertex3f( 1.0,  1.0, -1.0);
    glTexCoord2f(0.01, 0.99); glVertex3f( 1.0,  1.0,  1.0);
    glTexCoord2f(0.01, 0.01); glVertex3f( 1.0, -1.0,  1.0);
    // Left Face
    glNormal3f(-1.0, 0.0, 0.0);
    glTexCoord2f(0.01, 0.01); glVertex3f(-1.0, -1.0, -1.0);
    glTexCoord2f(0.99, 0.01); glVertex3f(-1.0, -1.0,  1.0);
    glTexCoord2f(0.99, 0.99); glVertex3f(-1.0,  1.0,  1.0);
    glTexCoord2f(0.01, 0.99); glVertex3f(-1.0,  1.0, -1.0);
  glEnd;

  glBindTexture(GL_TEXTURE_2D, Texture[TEX_SB_BOTTOM]);  // Bind the Texture to the object
  glBegin(GL_QUADS);
    // Bottom Face
    glNormal3f( 0.0,-1.0, 0.0);
    glTexCoord2f(0.99, 0.99); glVertex3f(-1.0, -1.0, -1.0);
    glTexCoord2f(0.01, 0.99); glVertex3f( 1.0, -1.0, -1.0);
    glTexCoord2f(0.01, 0.01); glVertex3f( 1.0, -1.0,  1.0);
    glTexCoord2f(0.99, 0.01); glVertex3f(-1.0, -1.0,  1.0);
  glEnd();
end;

_________________
Nein, ich bin nicht der turboPASCAL aus der DP, ich seh nur so aus... :P