Hi,

I tried to load mash model from a PLY file using mash_model_new_from_file() and 
it works.
If i try to add a texture, i see no change its color: i think the texture is 
not loaded.
I use the sample code copied from mash-0.2.0/mash/mash-ply-loader.c:

ClutterActor * m1 = mash_model_new_from_file(MASH_DATA_NONE, "test.ply", NULL);
CoglMaterial * material = 
COGL_MATERIAL(mash_model_get_material(MASH_MODEL(m1)));
CoglHandle texture = cogl_texture_new_from_file("texture.png", 
COGL_TEXTURE_NONE, COGL_PIXEL_FORMAT_ANY, NULL);
cogl_material_set_layer(material, 0, texture);
cogl_handle_unref(texture);

However, there was problem with the function cogl_material_set_layer(): in the 
sample code
a CoglHandle was passed as its first argument. I hope my modification is 
correct. At least i
see similar usage in the code.

The return values of the functions are checked against NULL and 
COGL_INVALID_HANDLE correspondingly,
but removed here for simplicity. No errors detected there.

I simplified my PLY file to a single rectangle, no result. If i change the 
color by calling the
function "cogl_material_set_diffuse()" it works: the whole object gets colored. 
If i try to add
colors to the vertices of my PLY file, it also does not work.

Thanx in advance
Gyorgy Kovesdi

_______________________________________________
clutter-app-devel-list mailing list
clutter-app-devel-list@clutter-project.org
http://lists.clutter-project.org/listinfo/clutter-app-devel-list

Reply via email to