It's very simple.
this class was introduced after 1.6, that's why you dont find docs.
Anyway:
1) create node and assign core geo
2) on core geo assign the SwitchMaterial
3) on SwitchMaterial assign the two materials
beginEditCP(_swMaterial, SwitchMaterial::MaterialsFieldMask);
_swMaterial->addMaterial(mat0);
_swMaterial->addMaterial(mat1);
endEditCP(_swMaterial, SwitchMaterial::MaterialsFieldMask);
4) Choose material to render with:
beginEditCP(_swMaterial, SwitchMaterial::ChoiceFieldMask);
_swMaterial->setChoice(SwitchChoice);
endEditCP(_swMaterial, SwitchMaterial::ChoiceFieldMask);
Josef
On Fri, Mar 7, 2008 at 3:00 PM, Sajjadul Islam <[EMAIL PROTECTED]> wrote:
> Hello Josef,
>
> Did you mean to use SwitchMaterial as a core instead of the SwitchPtr ?
>
>
> Let me elaborate again how did i do that of course with Björn's help.
>
>
> 1. read the utah teapot using the scene file handler. and assigned that to
> the NodePtr
>
> 2. Created another NodePtr and pointer to the same geometry that read at
> step 1.
>
> 3. Created 2 material group and assigned 2 different shader materials to
> each of them.
> Then created 2 NodePtr to hold above 2 material group. Again assigned
> each of
> the tea_pot NodePtr to each of the NodePtr that hold the
> MaterialGroupPtr as child.
>
>
> 4.created a switch nodeptr and assigned a switch core to that.
>
> 5. assigned the 2 NodePtr created at step 3 as children to switch NodePtr
> created at step 4.
>
>
> 6. Finally rendering the scene making the switch node ptr as root.
>
>
>
> If i use SwitchMaterial where should it fit in?
>
> I did not find any doc regarding that, so hint would be a great help i
> believe.
>
>
> And please let me know if my explanation is confusing at any point.
>
> Thanks
>
>
> Sajjad
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2008.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> _______________________________________________
> Opensg-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/opensg-users
>
>
--
Josef Grunig
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users