Results 1 to 2 of 2

Thread: Question about exporting diffuse color

  1. #1
    Junior Member
    Join Date
    Apr 2008
    Posts
    3

    Question about exporting diffuse color

    Hello All,

    I have a quick question about exporting color using collada DOM. First I'm trying

    Code :
     
           daeElement* effectLib = root->add("library_effects");
           daeElement * effect =  effectLib->add("effect");
           effect->setAttribute("id", sEffectName.c_str());
           daeElement* profile = effect->add("profile_COMMON");
           daeElement* technique = profile->add("technique");
           technique->setAttribute("sid", "common");
           technique->add("phong diffuse color");
           double rgb[3]=///blah blah;
     
            std::stringstream lColorStream;
            lColorStream<<rgb[0]<<" "<<rgb[1]<<" "<<rgb[2]<<" ";
            daeBool returnv = technique->setCharData("1 2 3");

    however returnv is false. What am I doing wrong?

    Second, following the method in the export example, I'm able to set my diffuse color to a texture, which works fine. Using the common profile though, is there a way to have botha diffuse color and a diffuse texture assigned to the same technique? If not, whats the best way to have both a diffuse color and a texture applied at the same time, other then baking the color into the texture?

    Regards,
    Jesse

  2. #2
    Senior Member
    Join Date
    Aug 2004
    Location
    California
    Posts
    771

    Re: Question about exporting diffuse color

    Quote Originally Posted by laeuchli
    however returnv is false. What am I doing wrong?
    <technique> doesn't have character data. Add the rgb value to the <color> element.
    Quote Originally Posted by laeuchli
    Using the common profile though, is there a way to have both a diffuse color and a diffuse texture assigned to the same technique?
    Either by using <newparam> or <extra> to define the value(s) and coding your application to use the value(s).

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •