Hey Neil,
thank you so much for sharing clutter-ply, I checked it out an it's amazing.
I could make the monkey example work, and I've been playing with it
with excellent results.
What I couldn't make it work, is applying a texture to any PLY file. I
followed your instructions, tried several models, and textures, and I
always get the model painted with the solid color defined by
cogl_material_set_color4ub.
I used the exact code as you posted, using
texture = cogl_texture_new_from_file ("models/models.png",
COGL_TEXTURE_NONE, COGL_PIXEL_FORMAT_ANY, &error);
I also checked that the texture is loaded successfully.
Any idea on what's wrong? In the COGL reference says that the color
set in cogl_material_set_color4ub will be used when no lighting is
enabled. Could be this the reason?
Thank you!
Marc
On Wed, Feb 10, 2010 at 10:31 AM, Neil Roberts <[email protected]> wrote:
> donn <[email protected]> writes:
>
>> Is there any chance of seeing that code?
>
> I've made a bug report against the clutter toys project to add the code
> as a standalone library called libclutter-ply. The code is in a large
> patch here:
>
> http://bugzilla.openedhand.com/show_bug.cgi?id=1983
>
> So the idea is you can create a Blender model and export as PLY then get
> an actor out of it with:
>
> actor = clutter_ply_model_new_from_file("somefile.ply", &error);
>
> If the model contains colors and texture coordinates those will be sent
> to GL when it renders. You can associate a texture with the model by
> attaching it to a material, eg:
>
> texture = cogl_texture_new_from_file("somefile.png", ...);
> material = cogl_material_new();
> cogl_material_set_layer(material, 0, texture);
> clutter_ply_model_set_material(model, material);
> cogl_handle_unref(material);
> cogl_handle_unref(texture);
>
> There's an example program using the library in the patch.
>
> There's very little API so it probably wouldn't take too much time for
> someone in the know to write Python bindings for it.
>
> - Neil
> --
> To unsubscribe send a mail to [email protected]
>
>
--
To unsubscribe send a mail to [email protected]