Skocz do zawartości
View in the app

A better way to browse. Learn more.

Max3D.pl

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Problem z wczytywaniem z 3ds

Featured Replies

Napisano

Mam pytanie jak moge wczytać kilka obiektów z jednego pliku 3ds.

Przykład: Robie w 3d maxie dwa szesciany i chce je odczytać a następnie wrzucić do OpenGL.Potrafie wczytać jeden obiekt ale nie mam pojęcia w jaki sposób wczytać ten drugi.

Z góry dziękuje

  • Odpowiedzi 4
  • Wyświetleń 1,5k
  • Created
  • Ostatniej odpowiedzi

Top Posters In This Topic

Napisano

Witam

 

Zalezy jakich bibliotek uzywasz. Napisz moze jak wczytujesz ten jeden.

 

Pozdrawiam.

Napisano
  • Autor

void ReadScene(void)

{

int i;

FILE *l_file;

 

unsigned short l_chunk_id;

unsigned int l_chunk_lenght;

 

unsigned char l_char;

unsigned short l_qty;

unsigned short l_face_flags;

if ((l_file=fopen (\"dwa.3ds\", \"rb\"))== NULL); //Open the file

while (ftell (l_file)

{

fread (&l_chunk_id, 2, 1, l_file); //Read the chunk header

fread (&l_chunk_lenght, 4, 1, l_file); //Read the lenght of the chunk

switch (l_chunk_id)

{

case 0x4D4D:

break;

case 0x3d3d:

break;

case 0x4130:

i=0;

do

{

fread (&l_char, 1, 1, l_file);

name1=l_char;

i++;

}while(l_char != \'\\0\' && i

break;

case 0x4000:

ilosc++;

i=0;

do

{

 

fread (&l_char, 1, 1, l_file);

name=l_char;

i++;

}while(l_char != \'\\0\' && i

break;

case 0x4100:

break;

case 0x4110:

fread (&l_qty, sizeof (unsigned short), 1, l_file);

vertices = l_qty;

for (i=0; i

{

fread (&vertex[0], sizeof(float), 1, l_file);

fread (&vertex[1], sizeof(float), 1, l_file);

fread (&vertex[2], sizeof(float), 1, l_file);

}

 

break;

case 0x4120:

fread (&l_qty, sizeof (unsigned short), 1, l_file);

polygons = l_qty;

for (i=0; i

{

fread (&polygon[0], sizeof (unsigned short), 1, l_file);

fread (&polygon[1], sizeof (unsigned short), 1, l_file);

fread (&polygon[2], sizeof (unsigned short), 1, l_file);

fread (&l_face_flags, sizeof (unsigned short), 1, l_file);

}

break;

default:

fseek(l_file, l_chunk_lenght-6, SEEK_CUR);

}

}

fclose (l_file);

 

}

Jeśli chcesz dodać odpowiedź, zaloguj się lub zarejestruj nowe konto

Powiadomienie o plikach cookie

Wykorzystujemy cookies. Przeczytaj więcej Polityka prywatności

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.