// load_model(fname,scale)
global.stg_tex[global.STG_ind,e]=background_get_texture(argument[2+e])
global.stg_mod[global.STG_ind,e]=d3d_model_create()
d3d_model_primitive_begin(global.stg_mod[global.STG_ind,e],pr_trianglelist)
for(i=0;i<nb_verts[e];i+=3)
{
vx1=GMBINReadFloat(re)*argument1;
vy1=GMBINReadFloat(re)*argument1;;
vz1=GMBINReadFloat(re)*argument1;;
nx1=(GMBINReadUByte(re)-127)/100
ny1=(GMBINReadUByte(re)-127)/100
nz1=(GMBINReadUByte(re)-127)/100
tx1=GMBINReadFloat(re)/10
ty1=GMBINReadFloat(re)/10
d3d_model_vertex_normal_texture(global.stg_mod[global.STG_ind,e],vx1,vy1,vz1,nx1,ny1,nz1,tx1,ty1)
vx2=GMBINReadFloat(re)*argument1;;
vy2=GMBINReadFloat(re)*argument1;;
vz2=GMBINReadFloat(re)*argument1;;
nx2=(GMBINReadUByte(re)-127)/100
ny2=(GMBINReadUByte(re)-127)/100
nz2=(GMBINReadUByte(re)-127)/100
tx2=GMBINReadFloat(re)/10
ty2=GMBINReadFloat(re)/10
d3d_model_vertex_normal_texture(global.stg_mod[global.STG_ind,e],vx2,vy2,vz2,nx2,ny2,nz2,tx2,ty2)
vx3=GMBINReadFloat(re)*argument1;;
vy3=GMBINReadFloat(re)*argument1;;
vz3=GMBINReadFloat(re)*argument1;;
nx3=(GMBINReadUByte(re)-127)/100
ny3=(GMBINReadUByte(re)-127)/100
nz3=(GMBINReadUByte(re)-127)/100
tx3=GMBINReadFloat(re)/10
ty3=GMBINReadFloat(re)/10
d3d_model_vertex_normal_texture(global.stg_mod[global.STG_ind,e],vx3,vy3,vz3,nx3,ny3,nz3,tx3,ty3)
p3dc_add_triangle(vx1,vy1,vz1,vx2,vy2,vz2,vx3,vy3,vz3)
}
d3d_model_primitive_end(global.stg_mod[global.STG_ind,e])NOTE : 'e' is the model index!
This is my own file format, wich handles multiples models
Problem : 'UNEXPECTED ERROR OCCURS WHEN RUNNING THE GAME' this is driving me crazy
Ok, the model is 2300*2300 large (a stage actually)
for some resons it show that error !! !WHY ??? (any ideas)
Edited by The Scorpion, 12 March 2012 - 02:10 PM.











