md2 problem!
4 posters
md2 problem!
I will load md2 model,but it not work! why?
there is my code:
loading function:
SIO2stream *_SIO2stream1 = sio2StreamOpen( "woman.md2", 1 );
{
// Initialize the handle
_SIO2md2 = sio2Md2Init( "woman.md2" );
sio2Md2Load( _SIO2md2, _SIO2stream1 );
_SIO2md2->_SIO2transform->scl->x = 0.031f;
_SIO2md2->_SIO2transform->scl->y = 0.031f;
_SIO2md2->_SIO2transform->scl->z = 0.031f;
sio2TransformBindMatrix( _SIO2md2->_SIO2transform );
}
_SIO2stream1 = sio2StreamClose( _SIO2stream1 );
Render function:
sio2WindowEnterLandscape3D();
{
sio2Md2Render( _SIO2md2,
sio2->_SIO2window, 1 );
}
sio2WindowLeaveLandscape3D();
there is my code:
loading function:
SIO2stream *_SIO2stream1 = sio2StreamOpen( "woman.md2", 1 );
{
// Initialize the handle
_SIO2md2 = sio2Md2Init( "woman.md2" );
sio2Md2Load( _SIO2md2, _SIO2stream1 );
_SIO2md2->_SIO2transform->scl->x = 0.031f;
_SIO2md2->_SIO2transform->scl->y = 0.031f;
_SIO2md2->_SIO2transform->scl->z = 0.031f;
sio2TransformBindMatrix( _SIO2md2->_SIO2transform );
}
_SIO2stream1 = sio2StreamClose( _SIO2stream1 );
Render function:
sio2WindowEnterLandscape3D();
{
sio2Md2Render( _SIO2md2,
sio2->_SIO2window, 1 );
}
sio2WindowLeaveLandscape3D();
LuisLee- Posts : 85
Join date : 2009-04-26
Age : 37
Re: md2 problem!
In loading function, after sio2TransformBindMatrix()
sio2Md2Play( _SIO2md2, 1 );
sio2Md2Play( _SIO2md2, 1 );
Francescu- Posts : 136
Join date : 2009-03-18
Re: md2 problem!
Francescu wrote:In loading function, after sio2TransformBindMatrix()
sio2Md2Play( _SIO2md2, 1 );
Thank you! I am try,but fail. The breakpoint at sio2Md2Render() function.
glDrawArrays( GL_TRIANGLES, 0, _SIO2md2->_SIO2md2header.num_tris * 3 );
LuisLee- Posts : 85
Join date : 2009-04-26
Age : 37
Re: md2 problem!
Try listing the MD2 frames in the console after loading such as:
unsigned int i = 0;
while( i != _SIO2md2->_SIO2md2header.num_frames )
{
printf("%d: %s\n", i, _SIO2md2->_SIO2md2frame[ i ].name );
++i;
}
Also, you might need to set some first action of your MD2 explicitly (am not sure at all of this but you should try) such as:
// Activate the action name
sio2Md2SetAction( _SIO2md2, actionName );
Are you building some actions manually like in tutorial14?
unsigned int i = 0;
while( i != _SIO2md2->_SIO2md2header.num_frames )
{
printf("%d: %s\n", i, _SIO2md2->_SIO2md2frame[ i ].name );
++i;
}
Also, you might need to set some first action of your MD2 explicitly (am not sure at all of this but you should try) such as:
// Activate the action name
sio2Md2SetAction( _SIO2md2, actionName );
Are you building some actions manually like in tutorial14?
Francescu- Posts : 136
Join date : 2009-03-18
Re: md2 problem!
Francescu wrote:Try listing the MD2 frames in the console after loading such as:
unsigned int i = 0;
while( i != _SIO2md2->_SIO2md2header.num_frames )
{
printf("%d: %s\n", i, _SIO2md2->_SIO2md2frame[ i ].name );
++i;
}
Also, you might need to set some first action of your MD2 explicitly (am not sure at all of this but you should try) such as:
// Activate the action name
sio2Md2SetAction( _SIO2md2, actionName );
Are you building some actions manually like in tutorial14?
my md2 files have not actions, I just want to render the model only.Not animated。
I do not know how to do。
LuisLee- Posts : 85
Join date : 2009-04-26
Age : 37
Re: md2 problem!
By the way, how to separate loading Models of texture? my model have not texture, don't use blender?
LuisLee- Posts : 85
Join date : 2009-04-26
Age : 37
Re: md2 problem!
Why would you use md2 if your model isn't animated? It makes no sense
oioioi- Posts : 136
Join date : 2008-12-02
Location : Norway
Re: md2 problem!
yes!The tutorial14 want to use blender. I would like loading a separate model and texture 。How to do this?oioioi wrote:Why would you use md2 if your model isn't animated? It makes no sense
LuisLee- Posts : 85
Join date : 2009-04-26
Age : 37
Re: md2 problem!
sio2interactive wrote:MD2 loading with SIO2 have nothing to do with blender...
int the tutorial14 Scenes, there is a cylinder,which was coupled with a mapping。How it is going on?
It is used to calculate the collision, is it? But why it was added in this map?
LuisLee- Posts : 85
Join date : 2009-04-26
Age : 37
Re: md2 problem!
You have to understand that the collision bound and the model is 2 different things... The tutorial show you how to link a collision object to another model... so you won't have to do collision test with the detailed model.
Re: md2 problem!
sio2interactive wrote:You have to understand that the collision bound and the model is 2 different things... The tutorial show you how to link a collision object to another model... so you won't have to do collision test with the detailed model.
Yes! What you said is correct!I do not have the demo in the collision, I is clear.However, I would like to find out is: how to separate into md2 scene? it does not have animation.I improved my code,like this:
loading function:
SIO2stream *_SIO2stream1 = sio2StreamOpen( "woman.md2", 1 );
{
// Initialize the handle
_SIO2md2 = sio2Md2Init( "woman.md2" );
pMd2image= sio2ImageInit( "womantexture.png" );
_SIO2md2->_SIO2material=sio2MaterialInit( "womantexture.png" );
sio2Md2Load( _SIO2md2, _SIO2stream1 );
_SIO2md2->_SIO2material->_SIO2image[ SIO2_MATERIAL_CHANNEL0 ] = pMd2image;
_SIO2md2->_SIO2transform->scl->x = 0.031f;
_SIO2md2->_SIO2transform->scl->y = 0.031f;
_SIO2md2->_SIO2transform->scl->z = 0.031f;
sio2TransformBindMatrix( _SIO2md2->_SIO2transform );
}
_SIO2stream1 = sio2StreamClose( _SIO2stream1 );
Render function:
sio2WindowEnterLandscape3D();
{sio2Md2Render( _SIO2md2, sio2->_SIO2window, 1 );}
sio2WindowLeaveLandscape3D();
In the run-time errors!
LuisLee- Posts : 85
Join date : 2009-04-26
Age : 37
Re: md2 problem!
Make sure that the PNG is not compressed by XCode, browse this forum for more info...
Re: md2 problem!
sio2interactive wrote:Make sure that the PNG is not compressed by XCode, browse this forum for more info...
that the PNG is not compressed by XCode,Texture size 256x256.Unable to work!
LuisLee- Posts : 85
Join date : 2009-04-26
Age : 37
LuisLee- Posts : 85
Join date : 2009-04-26
Age : 37
Re: md2 problem!
sio2interactive wrote:Make sure that the PNG is not compressed by XCode, browse this forum for more info...
that the PNG is not compressed by XCode,Texture size 256x256.Unable to work!
LuisLee- Posts : 85
Join date : 2009-04-26
Age : 37
Re: md2 problem!
Im pretty sure that you are missing something... the one used in tutorial14 is also a PNG at 256x256... where GDB breaks?
Re: md2 problem!
sio2interactive wrote:Im pretty sure that you are missing something... the one used in tutorial14 is also a PNG at 256x256... where GDB breaks?
Breakpoint in the sio2Md2Render() function,
at the
glDrawArrays( GL_TRIANGLES, 0, _SIO2md2->_SIO2md2header.num_tris * 3 );
Blender useless software, I set up scenes and sio2 not read any blender file, only to let the mixed 2d and 3d.
LuisLee- Posts : 85
Join date : 2009-04-26
Age : 37
Re: md2 problem!
Blender useless software, I set up scenes and sio2 not read any blender file, only to let the mixed 2d and 3d.
>> Dude you can easily mix 2D and 3D with SIO2...
glDrawArrays( GL_TRIANGLES, 0, _SIO2md2->_SIO2md2header.num_tris * 3 );
>> Have you set the proper client states?
>> Dude you can easily mix 2D and 3D with SIO2...
glDrawArrays( GL_TRIANGLES, 0, _SIO2md2->_SIO2md2header.num_tris * 3 );
>> Have you set the proper client states?
Re: md2 problem!
sio2interactive wrote:Blender useless software, I set up scenes and sio2 not read any blender file, only to let the mixed 2d and 3d.
>> Dude you can easily mix 2D and 3D with SIO2...
glDrawArrays( GL_TRIANGLES, 0, _SIO2md2->_SIO2md2header.num_tris * 3 );
>> Have you set the proper client states?
sorry,I don't set the proper client states.I am not very clear what you mean。would you please say it in detail?
but I use state like this:
sio2WindowEnterLandscape3D();
{ draw something; }
sio2WindowLeaveLandscape3D();
sio2WindowEnter2D( );
{
sio2WindowEnterLandscape2D( sio2->_SIO2window );
{
draw something;
}
sio2WindowLeaveLandscape2D( sio2->_SIO2window );
}
sio2WindowLeave2D();
LuisLee- Posts : 85
Join date : 2009-04-26
Age : 37
Re: md2 problem!
ok,it work!Thank you very much! but want to change code.
LuisLee- Posts : 85
Join date : 2009-04-26
Age : 37
Similar topics
» Skeletal animation (Tutorial #15)
» Passing Through Static Object (Beating my iPod seems to help)
» Camera problems
» 3ds import problem
» problem with camera look down?
» Passing Through Static Object (Beating my iPod seems to help)
» Camera problems
» 3ds import problem
» problem with camera look down?
Permissions in this forum:
You cannot reply to topics in this forum