Professional Web Applications Themes

putting a texture map on a model - Macromedia Director 3D

hello; I have a model, created in Lightwave; in Dir. I have applied meshdeform modifier; I have a jpg in the cast; the jpg is the texture map produced in LW as per a UV map in LW; now I want to get the jpg onto the model; I have a book, Director 8.5 Shockwave Studio for 3D, that suggests that this is possible, but it does not elaborate; I suppose that I will need vertexlist and texturecoordinatelist and somehow tell director to take the (Uth,Vth) pixel of the texture map jpg and place it at the (Xth,Yth,Zth) position? any ...

  1. #1

    Default putting a texture map on a model

    hello;

    I have a model, created in Lightwave; in Dir. I have applied meshdeform
    modifier;

    I have a jpg in the cast; the jpg is the texture map produced in LW as per a
    UV map in LW;

    now I want to get the jpg onto the model;

    I have a book, Director 8.5 Shockwave Studio for 3D, that suggests that this
    is possible, but it does not elaborate;

    I suppose that I will need vertexlist and texturecoordinatelist and somehow
    tell director to take the (Uth,Vth) pixel of the texture map jpg and place it
    at the (Xth,Yth,Zth) position?

    any thoughts, books, tutorials, phone call?

    thanks
    dsdsdsdsd
    Chicago

    dsdsdsdsd Guest

  2. #2

    Default Re: putting a texture map on a model

    You should know the name of the texture. I don't use Lightwave, but in
    MAX and Maya, it is the name of the texture in the texture
    explorer/hypershade. If you don't know it, find it. Put the member
    into Director's Object Explorer...

    member("3dmembername")

    Now you can drill down to see all the models and the shaders and
    textures applied to them. Find the name of the texture you are wanting
    to change.

    Then, this command will swap it out (substitute everything in quotes
    with the real names from your file):

    member("3dmembername").texture("texturename").imag e=member("yourjpgmember").image
    Mike Guest

  3. #3

    Default Re: putting a texture map on a model

    Mike, thanks for the response;

    I will give it a shot;

    thanks,
    dsdsdsdsd


    dsdsdsdsd Guest

  4. #4

    Default Re: putting a texture map on a model

    Mike, although this method does change out the texture( actually the image for
    the texture), the new image is not aligned according to the UV mapping rules;

    so I need to use Lingo to 'tell' director how to apply/align the image when I
    make the swap;

    thanks
    dsdsdsdsd

    dsdsdsdsd Guest

  5. #5

    Default Re: putting a texture map on a model

    You shouldn't need to if the model is mapped in the 3d software already
    before it gets exported. I pretty often will setup some specific UV
    mapping for a model in MAX, then swap out the image at runtime. The uvs
    are baked into the model, and I don't know of a way to change them on
    the fly. You will have to make your new image so that it lines up with
    the old one.
    Mike Guest

  6. #6

    Default Re: putting a texture map on a model

    Mike,

    have you actually done this before:
    1 - make model(3dmax for you), create UV map for model, apply image/texture
    using the UV map in 3dsmax;
    2 - export to w3d;
    3 - in Director,
    member("3dmembername").texture("texturename").imag e=member("yourjpgmember").imag
    e;


    and it worked for you??

    dsdsdsdsd Guest

  7. #7

    Default Re: putting a texture map on a model

    Yes. In fact I did it today.
    Mike Guest

  8. #8

    Default Re: putting a texture map on a model

    hmm ... I must be missing something;
    dsdsdsdsd Guest

  9. #9

    Default Re: putting a texture map on a model

    Mike, what version of Director are you using?

    I am using version 9;


    dsdsdsdsd Guest

  10. #10

    Default Re: putting a texture map on a model

    I am using V10 (Dir MX 2004). I don't remember if I ever did the same
    thing in D9, but I think it should work... what is happening exactly?
    Any error messages?
    Mike Guest

  11. #11

    Default Re: putting a texture map on a model

    no error messages; it is replacing the texture, but the wrapping is incorrect,
    ie it is not abiding by the UV map;

    however, if I include in my w3d( created in Lightwave ):
    1- a dummy model, regardless of its shape/geometry, with the baked texture
    jpg applied to it without any particular mapping
    2 - my good model with some random 1x1 imageand
    3 - then in Director assign the baked jpg to the good model's shader's
    texture, it works;

    seems like the UV info is being brought in to director with the model, not the
    shader or texture, but that only textures/jpgs that are also brought in in the
    same w3d are working;

    confusing;



    dsdsdsdsd Guest

  12. #12

    Default Re: putting a texture map on a model

    Hi

    I?m a Lightwave-Director 2004 user and swapping the image texture on the
    shader works well for me. You can try add the meshDeform Modifier to the model
    and check & save as a text file the textureCoordinateList of the meshes before
    and after swapping the texture`s image in the model, if both list aren?t equal
    there?s some problem with the texture coordinates on memory and could be
    resolved copying the texCoords before swapping and pasted again after that. I
    remember some issue about changing images on textures from imported W3D files
    on Dir 9, it doesn?t happens on runtime created geometry or Director 2004.

    Have a nice coding!!!


    DAVID Guest

  13. #13

    Default Re: putting a texture map on a model

    My new image map is also being applied incorrectly. I have applied the
    meshDeform modifier, but am having trouble accessing the textureCoordinateList
    as David recommends. I am using the below code.

    --trace(member("BlueMan").modelResource[2].textureCoordinateList)

    ...this returns Script error: Property not found. I assume this is not the
    correct syntax for this operation. What would you suggest?

    [Director MX 2004 | Windows XP | .w3d was exported from LightWave 8.5]

    adam@blueapplestudio Guest

  14. #14

    Default Re: putting a texture map on a model

    Don't mean to give this a bump, but I haven't heard anything for almost a month.

    I am still trying to access my texture coordinates (as David Najar suggested)
    to see if my mapping is being changed. Some of my code is below. Any help is
    greatly appreciated.

    on exitFrame me

    --Resets the 3D cast members
    member("BlueMan").resetWorld()

    --Applies the meshDeform modifier to the cast member.
    member("BlueMan").model("BlueMan").addModifier(#me shDeform)

    --Outputs different messages, accessible now that meshDeform has been
    applied.
    trace(member("BlueMan").model("BlueMan").meshDefor m.face.count) -- Outputs
    568
    trace(member("BlueMan").model("BlueMan").meshDefor m.mesh.count) -- Outputs 1
    trace(member("BlueMan").modelResource[1]) -- Outputs plane("DefaultModel")
    trace(member("BlueMan").modelResource[2]) -- Outputs modelResource("BlueMan")

    put member("BlueMan").modelResource("BlueMan").texture CoordinateList--Script
    error: Property not found

    end

    adam@blueapplestudio Guest

Similar Threads

  1. Scaling a model not it's texture?
    By George Webb in forum Macromedia Director 3D
    Replies: 3
    Last Post: August 23rd, 08:25 AM
  2. Putting an imported model under Havok Control
    By TedMeister webforumsuser@macromedia.com in forum Macromedia Director 3D
    Replies: 0
    Last Post: December 23rd, 04:18 PM
  3. How to change texture on a 3d cad model
    By vitopod webforumsuser@macromedia.com in forum Macromedia Director 3D
    Replies: 1
    Last Post: November 25th, 12:31 PM
  4. Texture error on model?
    By markinoregon in forum Macromedia Director 3D
    Replies: 5
    Last Post: November 13th, 02:58 AM
  5. texture and model
    By visu webforumsuser@macromedia.com in forum Macromedia Director 3D
    Replies: 0
    Last Post: September 3rd, 01:25 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