Professional Web Applications Themes

5 models with the same texture, how!!?? - Macromedia Director 3D

i am a strager novice in director 3d and i have 5 models in my 3d world that need to have the same texture on them. i know how to apply on a model a time, but not on 5 at the same time. if there?s a way and someone could help me with code. many,many thanks in advance....

  1. #1

    Default 5 models with the same texture, how!!??

    i am a strager novice in director 3d and i have 5 models in my 3d world that
    need to have the same texture on them. i know how to apply on a model a time,
    but not on 5 at the same time. if there?s a way and someone could help me with
    code. many,many thanks in advance.

    catarrento Guest

  2. #2

    Default Re: 5 models with the same texture, how!!??

    > i am a strager novice in director 3d and i have 5 models in my 3d world that
    > need to have the same texture on them. i know how to apply on a model a time,
    > but not on 5 at the same time. if there?s a way and someone could help me with
    > code. many,many thanks in advance.
    >
    You just have to use the same shader for all 5 models. If you change the
    texture on this shader it will affect all models, which use it.
    Andrej Hellwig Guest

  3. #3

    Default Re: 5 models with the same texture, how!!??

    here's some code. dunno what your w3d world is called, but for example i'm
    gonna say "w3d". first thing we're going to do is to make a new shader for the
    models, second we're going to make a new texture using a bitmap cast member
    called "theTexture" and then we're going to assign the texture to the shader.
    to apply the shader to the models we are going to use a repeat with loop. i get
    the ipression the only five models in the w3d world are the onew you want to
    apply the texture to so the repeat with loop can use w3dworld.model.count to
    know how many times to loop. ok, here we go with the code. oh yeah, one thing
    first: you need to reset your world every time you start the movie or you'll
    wind up getting some errors. you can put all the code in a movie script like
    this:





    on prepareMovie

    w3d = member("w3d") -- create reference variable

    if w3d.state <> 4 then -- ensure the world is fully loaded before continuing
    go the frame
    end if

    w3d.resetWorld() -- reset the wolrd

    w3d.newShader("yourShader",#standard) -- create the shader, call it
    whatever you feel like calling it
    w3d.newTexture("yourTexture" ,#fromCastMember,member("theTexture")) --
    create new texture from the bitmap in your cast
    w3d.shader("yourShader").texture = w3d.texture("yourTexture") -- assign the
    texture to the shader

    -- this loop will assign the shader you created to all the models in your
    movie
    repeat with mCount = 1 to w3d.model.count
    w3d.model(mCount).shader = w3d.shader("yourShader")
    end repeat

    end

    Ex Malterra Guest

Similar Threads

  1. 3D models
    By davidsteenson06 in forum Macromedia Director 3D
    Replies: 3
    Last Post: August 16th, 10:58 PM
  2. Texture mapping and cloned models.
    By ensamblador in forum Macromedia Director 3D
    Replies: 1
    Last Post: June 1st, 11:09 AM
  3. Copy models
    By WrongAgain in forum Macromedia Director 3D
    Replies: 1
    Last Post: November 16th, 03:49 PM
  4. models can be seen?
    By cz in forum Macromedia Director 3D
    Replies: 0
    Last Post: August 29th, 05:15 PM
  5. w3d models
    By vulcanpimp webforumsuser@macromedia.com in forum Macromedia Director 3D
    Replies: 4
    Last Post: July 21st, 09:39 AM

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