loading .bin models from nitrodir

t377y000
Posts: 52
Joined: Wed Jun 02, 2010 3:14 am
Location: United States

loading .bin models from nitrodir

Post by t377y000 » Tue May 06, 2014 3:45 pm

hi i have been trying to find a way to load this .bin model "basiccubeX64.bin with nitrodir.
(basically a .x model converted with n"ds model exporter" to .bin)

here is the source im attempting with.
FILE *pFile; char * buffer; size_t dataInFile; long fileSize;

pFile = fopen("basiccubeX64.bin", "rb");
fseek(pFile, 0, SEEK_END);
fileSize = ftell(pFile);
rewind(pFile);
buffer = (char*)malloc(fileSize+1); //buffer = (char*) malloc (sizeof(char)*fileSize);
dataInFile = fread(buffer, 1, fileSize, pFile);
fclose(pFile); //free(buffer);

glPushMatrix();
glMatrixMode(GL_TEXTURE);
glLoadIdentity();
glMatrixMode(GL_MODELVIEW);
get_glPolyFormats(); get_glMats();
glTranslatef(0,0,0); glRotateX(-90); glScalef(10,10,10);
glBindTexture( 0,house2tex64_texid); glCallList((u32*)dataInFile);
glPopMatrix(1);
im also using these includes.
#include <filesystem.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <dirent.h>

t377y000
Posts: 52
Joined: Wed Jun 02, 2010 3:14 am
Location: United States

Re: loading .bin models from nitrodir

Post by t377y000 » Sat May 10, 2014 8:19 pm

bump? anyone?

elhobbs
Posts: 353
Joined: Thu Jul 02, 2009 1:19 pm

Re: loading .bin models from nitrodir

Post by elhobbs » Tue May 13, 2014 4:09 am

I think you will have better luck with a response if you ask an actual question or describe the problems you are experiencing.

t377y000
Posts: 52
Joined: Wed Jun 02, 2010 3:14 am
Location: United States

Re: loading .bin models from nitrodir

Post by t377y000 » Thu May 15, 2014 8:03 am

The question how do I load the .bin models converted with nds model exporter.exe.
The problem is when I boot the game an error says glCallList is null.

elhobbs
Posts: 353
Joined: Thu Jul 02, 2009 1:19 pm

Re: loading .bin models from nitrodir

Post by elhobbs » Fri May 16, 2014 7:30 am

For starters fread returns the number of elements read - not a pointer to data.

t377y000
Posts: 52
Joined: Wed Jun 02, 2010 3:14 am
Location: United States

Re: loading .bin models from nitrodir

Post by t377y000 » Tue May 20, 2014 12:14 am

so how would i fix this? i'm puzzled at the moment.

WinterMute
Site Admin
Posts: 1403
Joined: Tue Aug 09, 2005 3:21 am
Location: UK
Contact:

Re: loading .bin models from nitrodir

Post by WinterMute » Tue May 20, 2014 10:46 am

With the code you posted :-

Code: Select all

-glBindTexture( 0,house2tex64_texid); glCallList((u32*)dataInFile);
+glBindTexture( 0,house2tex64_texid); glCallList((u32*)buffer);
Help keep devkitPro toolchains free, Donate today

devkitPro IRC support
Personal Blog

t377y000
Posts: 52
Joined: Wed Jun 02, 2010 3:14 am
Location: United States

Re: loading .bin models from nitrodir

Post by t377y000 » Tue May 20, 2014 6:57 pm

hmm still nothing with desmume i get a black screen, with nocashgba i get invalid gx command popups.
heres a screencap.
Image

& heres another with the code moved around
Image

t377y000
Posts: 52
Joined: Wed Jun 02, 2010 3:14 am
Location: United States

Re: loading .bin models from nitrodir

Post by t377y000 » Tue May 20, 2014 9:24 pm


t377y000
Posts: 52
Joined: Wed Jun 02, 2010 3:14 am
Location: United States

Re: loading .bin models from nitrodir

Post by t377y000 » Thu May 22, 2014 6:01 am

well still no luck guys. i moved the FILE part form the loop

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests