3 Replies Latest reply on Oct 31, 2007 12:29 AM by cubelan2

    3D color surface

    cubelan2
      Hello.
      I have some walls in a 3D world and I would like to dynamically put a color on such walls. I mean, I do not want to put any texture of a single color, but to be able, by script, to put it a color.
      How can I do it?

      Thank you in advance.

      Best regards.
        • 1. 3D color surface
          Erhard Zrust
          I don't fully understand your question. What do you mean with "I don't want to use a texture"? that you don't want to create one in your 3D app?

          Supposing this, what you can do is create a texture from a one color pic, and the shader on the fly in lingo and then set the shaderlist of the model to this shader, the code below should give you an example.

          Edit: in the code, I forgot to erase the picture as you don't need it any more

          tPic.erase()
          • 2. Re: 3D color surface
            code1234 Level 1
            Or if you just want to use lingo to change the diffuse color of the walls model:

            myShader= member("my3dWallsName").shader("_myWallsShaderName")
            myShader.diffuse = rgb( 255, 0, 0)
            • 3. Re: 3D color surface
              cubelan2 Level 1
              That's exactly what I needed.
              Thank you very much.

              Best regards.

              Ps: I wanted to mean that I didn't want to create a texture in Photoshop, import it and so on. But creat a one-color texture with Lingo is perfect.