texture transform

View previous topic View next topic Go down

texture transform

Post  Don Jaffa on Tue May 19, 2009 12:10 pm

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

View user profile

Back to top Go down

Re: texture transform

Post  sio2interactive on Tue May 19, 2009 2:14 pm

Check tutorial14

_________________
SIO2 Interactive
Free Open Source 3D Game Engine for iPhone and iPod Touch
http://sio2interactive.com
avatar
sio2interactive

Posts : 1526
Join date : 2008-08-26
Age : 38
Location : Shanghai

View user profile http://sio2interactive.com

Back to top Go down

Re: texture transform

Post  Don Jaffa on Tue May 19, 2009 2:43 pm

Ahh ok cheers Very Happy

Don Jaffa

Posts : 49
Join date : 2009-02-19

View user profile

Back to top Go down

problem to assign a new texture to my object

Post  djjd on Sun Jun 28, 2009 11:00 pm

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:

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


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

View user profile

Back to top Go down

Re: texture transform

Post  Sponsored content


Sponsored content


Back to top Go down

View previous topic View next topic Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum