I want to put an bitmap image over that object.
Do you mean .bmp file by "bitmap" image? Cortona does not support BMP as textures.
Can somebody explain me what is not correct here and how can I do that.
Technically, the code is correct. It should work.
Keep in mind, that if the "root" scene was not loaded from any URL (via Scene property) but created from scratch, there is no such thing as "base URL", and fully qualified URLs should be specified for all resources you're trying to load.
As an advice, to make your code more simple, concern over the possibility of use ATL classes: CComVariant as replacement of plane VARIANT, CComBSTR as wrapper for BSTR type etc.
Yes, I used .bmp files. Now I tried with .PNG and .GIF but it does not work too. If I do not put the value:
m_AppearanceNode->put_Value(Appear))
I see the object, but when I use Value I don't see anything. Maybe the problem is here:
I don't load the "root" scene from any URL (via Scene property). That what I do is:
1. I create "SwitchNode" with CreateNode()
2. I create "ShapeNode" with CreateNode()
3. I create "IndexedFaceSet" with CreateNode()
4. I put the IndexedFaceSet in the geometry field
of the "ShapeNode"
5. I create some "AppearanceNode" with
CreateNodeFromString()
6. I put the AppearanceNode in the appearance field
of the "ShapeNode"
7. I add the ShapeNode to the children field of the
SwitchNode
If I don't use the Apperiance I see the Object.
If I use the Apperiance I don't see the Object.