Professional Web Applications Themes

3D color surface - Macromedia Director 3D

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. #1

    Default 3D color surface

    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.

    cubelan2 Guest

  2. #2

    Default Re: 3D color surface

    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.

    -- create a new bitmap member
    ------------------------------------------
    tPic = _movie.newmember(#bitmap)
    tPic.image = image(2,2,32)
    tPic.image.fill(0, 0, 2, 2, rgb(100, 100, 100)) -- fill the picture with a
    color

    -- build texture from pic
    -------------------------------
    tTex = member("world").newtexture(tTextureName, #fromimageobject, tPic.image)

    -- build shader and assign texture
    ----------------------------------------------
    tShad = member("world").newShader("Example_Shader", #standard)
    tShad.texturelist[1] = tTex

    -- assign the shader to the model
    --------------------------------------------
    member("3Dmember").model("MyModel").shaderList[1] = tShad

    Erhard Guest

  3. #3

    Default Re: 3D color surface

    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)
    code1234 Guest

  4. #4

    Default Re: 3D color surface

    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.

    cubelan2 Guest

Similar Threads

  1. text rollOver on 3D surface
    By frank in forum Macromedia Director 3D
    Replies: 1
    Last Post: October 21st, 08:53 AM
  2. rollover on a 3D surface
    By frank in forum Macromedia Director 3D
    Replies: 4
    Last Post: October 20th, 04:08 PM

Bookmarks

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139