texture transform
3 posters
texture transform
Just wondering, does anyone know if it is possible to do texture translation like in tut 10 in engine rather than in lua?
Don Jaffa- Posts : 49
Join date : 2009-02-19
problem to assign a new texture to my object
Hi, All,
I am also trying to change the texture of one object I have loaded. In blender, I have assigned one material with one image. After loaded, I want to change the material with another image.
I have tried the following code, following the example in Tutorial 14:
The result is that my object is becoming transparent and show the background color. The new material is not assigned properly. But if I remove the last line of code and add the "diffuse change code" now commented, I can change the color of the object. So it seems that I have
missed something in blender object texture setting or the last line of code is not correct. Can anybody help? Many thanks!
Best Regards,
djjd
I am also trying to change the texture of one object I have loaded. In blender, I have assigned one material with one image. After loaded, I want to change the material with another image.
I have tried the following code, following the example in Tutorial 14:
sio2MateiralReset();
SIO2object *_SIO2obj1 = ( SIO2object * )sio2ResourceGet( sio2->_SIO2resource,
SIO2_OBJECT,
"object/obj1" );
SIO2stream *_SIO2stream = NULL;
SIO2material *_SIO2material = sio2MaterialInit("blank");
_SIO2stream = sio2StreamOpen( "streak1.tga", 1 ); // steak1.tga is copied from the /data dir and used for my new material for test
// _SIO2material->diffuse->x = 0.0f;
// _SIO2material->diffuse->y = 1.0f;
_SIO2material->blend = SIO2_MATERIAL_ALPHA;
_SIO2material->_SIO2image[SIO2_MATERIAL_CHANNEL0] = sio2ImageInit("");
sio2ImageLoad(_SIO2material->_SIO2image[SIO2_MATERIAL_CHANNEL0],_SIO2stream);
sio2ImageGenId(_SIO2material->_SIO2image[SIO2_MATERIAL_CHANNEL0], SIO2_IMAGE_CLAMP,0.0f);
_SIO2stream = sio2StreamClose(_SIO2stream);
_SIO2obj1->_SIO2vertexgroup[0]->_SIO2material = _SIO2material; // I am not sure about this line of code. Actually I don't know how to assign the new material to my object
SIO2object *_SIO2obj1 = ( SIO2object * )sio2ResourceGet( sio2->_SIO2resource,
SIO2_OBJECT,
"object/obj1" );
SIO2stream *_SIO2stream = NULL;
SIO2material *_SIO2material = sio2MaterialInit("blank");
_SIO2stream = sio2StreamOpen( "streak1.tga", 1 ); // steak1.tga is copied from the /data dir and used for my new material for test
// _SIO2material->diffuse->x = 0.0f;
// _SIO2material->diffuse->y = 1.0f;
_SIO2material->blend = SIO2_MATERIAL_ALPHA;
_SIO2material->_SIO2image[SIO2_MATERIAL_CHANNEL0] = sio2ImageInit("");
sio2ImageLoad(_SIO2material->_SIO2image[SIO2_MATERIAL_CHANNEL0],_SIO2stream);
sio2ImageGenId(_SIO2material->_SIO2image[SIO2_MATERIAL_CHANNEL0], SIO2_IMAGE_CLAMP,0.0f);
_SIO2stream = sio2StreamClose(_SIO2stream);
_SIO2obj1->_SIO2vertexgroup[0]->_SIO2material = _SIO2material; // I am not sure about this line of code. Actually I don't know how to assign the new material to my object
The result is that my object is becoming transparent and show the background color. The new material is not assigned properly. But if I remove the last line of code and add the "diffuse change code" now commented, I can change the color of the object. So it seems that I have
missed something in blender object texture setting or the last line of code is not correct. Can anybody help? Many thanks!
Best Regards,
djjd
djjd- Posts : 3
Join date : 2009-06-22
Similar topics
» Draw font to texture or render to texture possible?
» _SIO2parent transform?
» How to get Transform from Physic Object?
» 1.4 transform and linear velocity bug
» Simple Transform Animation System
» _SIO2parent transform?
» How to get Transform from Physic Object?
» 1.4 transform and linear velocity bug
» Simple Transform Animation System
Permissions in this forum:
You cannot reply to topics in this forum