Thanks for the various answers .... 

 First I downloaded MeshLab and tried to create a cube and color it ... 
actually OSG colors it well and I'm happy with that. 

 However, the problem arises when I attach a texture to a face. In fact, 
the .mtl file is created and this is managed as a material and then 
everything returns as before and OSG fails not knowing how to manage it 
.... 

 My need is to import complex .obj models (boats) containing a lot of 
textures ....

Il giorno mercoledì 28 settembre 2022 alle 07:13:35 UTC+2 
[email protected] ha scritto:

> Yes, you are right!
>
> I knew also vertex colors are supported but wasn't sure if that was in the 
> 'v' or separate parameter. It's been a while since I worked with it, and I 
> think most of the Editors supports it when dealing with point clouds, not 
> sure for 3D models
>
> On Tue, Sep 27, 2022 at 9:43 PM [email protected] <
> [email protected]> wrote:
>
>> Trajce, 
>>
>> The way I read it, they can't use materials to colour their object. 
>>
>> OSG's .OBJ reader supports vertex colours when written like this:
>>
>> v -7.941349983215332 -11.136899948120117 -3.4483699798583984       1.0 
>> 0.0 0.0
>>
>> with the last three values here being the red, the green and the blue. 
>>
>> This works at least with the text version of .OBJ files. If the user has 
>> actually access to the .mtl file, your approach is fine. This vertex colour 
>> approach here is an alternative, although, as I understand, it's not 
>> totally supported by 3d graphics editors. 
>>
>> - Vaillancourt
>>
>> On Tuesday, September 27, 2022 at 2:14:51 p.m. UTC-4 
>> [email protected] wrote:
>>
>>> Hi,
>>>
>>> obj does support colouring by using mtl (material) associated text file 
>>> where materials are defined with all the color and texture info in it. if 
>>> the obj is text (not binary) you can set your material to be used per face 
>>> for example in text editor - for binary you are left to your modelling 
>>> software. And the osg obj loader uses the mtl file if present - from real 
>>> cases with obj from Blender you might need to adjust some color properties 
>>> in text editor
>>>
>>> On Tue, Sep 27, 2022 at 8:42 PM [email protected] <
>>> [email protected]> wrote:
>>>
>>>> Hello Marco(?)
>>>>
>>>> Although wavefront .obj don't support vertex colours out of the box, it 
>>>> appears the OSG obj plugin code can read vertex colours the way MeshLab 
>>>> outputs it. I'm not sure how it's done, but I would give it a try. 
>>>>
>>>>
>>>> On Tuesday, September 27, 2022 at 10:23:50 a.m. UTC-4 
>>>> [email protected] wrote:
>>>>
>>>>> Hi,
>>>>>
>>>>> if I can't use material to color the model loaded from obj file, now 
>>>>> how can I color that model avoiding to use shaders?
>>>>>
>>>>>
>>>>>
>>>>> Thanks
>>>>>
>>>> -- 
>>>> You received this message because you are subscribed to the Google 
>>>> Groups "OpenSceneGraph Users" group.
>>>> To unsubscribe from this group and stop receiving emails from it, send 
>>>> an email to [email protected].
>>>> To view this discussion on the web visit 
>>>> https://groups.google.com/d/msgid/osg-users/c4473ca3-286e-4c9d-8a9f-4870af61f197n%40googlegroups.com
>>>>  
>>>> <https://groups.google.com/d/msgid/osg-users/c4473ca3-286e-4c9d-8a9f-4870af61f197n%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>> .
>>>>
>>>
>>>
>>> -- 
>>> trajce nikolov nick
>>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "OpenSceneGraph Users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to [email protected].
>>
> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/osg-users/909a77b0-5159-4cc3-93a0-44039fecc91bn%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/osg-users/909a77b0-5159-4cc3-93a0-44039fecc91bn%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>
>
> -- 
> trajce nikolov nick
>

-- 
You received this message because you are subscribed to the Google Groups 
"OpenSceneGraph Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/osg-users/48e34a18-14bf-4db1-a084-16cc6304d4b6n%40googlegroups.com.

Reply via email to