Professional Web Applications Themes

Applying colour to 3D model in a 3D member - Macromedia Director 3D

Heylo, I am trying to drag and drop colours onto a model in a 3D world. The model is called Wall01. My code is working for dragging the colours that have been created in director paint. However the wall model is not changing colour to match what is dragged onto it. Instead the colour squares when dragged to the shockwave file are going behind it. Its some weird stuff happening here. I ain't sure what to do and well yeah. From Nat Anyting is possible...just gotta figure out how...

  1. #1

    Default Applying colour to 3D model in a 3D member

    Heylo,
    I am trying to drag and drop colours onto a model in a 3D world. The model is
    called Wall01. My code is working for dragging the colours that have been
    created in director paint. However the wall model is not changing colour to
    match what is dragged onto it. Instead the colour squares when dragged to the
    shockwave file are going behind it. Its some weird stuff happening here.

    I ain't sure what to do and well yeah.

    From Nat


    Anyting is possible...just gotta figure out how

    naddasmiles Guest

  2. #2

    Default Re: Applying colour to 3D model in a 3D member

    Hello Nat,

    You have done part of the job, the dragging of color squares.
    Now you need to do the second part: altering the existing code to change the
    color in the 3D scene

    You need to know the RGB value of color squares, either through variables or
    by reading the RGB value with the getPixel instruction. You also need to assign
    this RGB value to the diffuse color of the model shader.

    You could have this in a parent script or a behavior:

    property pBitmapSquareMember
    property pTargetModel
    property pTargetShader
    property pRGBColor


    -- Handler called by your drag'n'drop behavior when the mouse is released

    on dropped me

    -- Use spriteSpaceToWorldSpace() with mouseH and mouseV
    -- Use modelsUnderRay() to know what model you hover
    -- Change the diffuse property of the shader

    pTargetShader.diffuse = pRGBColor

    end

    Cheers,
    Karl.

    [url]http://www.chromelib.com[/url]




    Newt99 Guest

  3. #3

    Default Re: Applying colour to 3D model in a 3D member

    Also, if you want a continuity between the 2D area and the 3D area of your
    project, you can use overlays in other to display tge colour square bitmaps on
    top of the 3D scene.

    Use camera.addOverlay() for this. You can update overlays position to follow
    the mouse moves.



    Newt99 Guest

  4. #4

    Default Re: Applying colour to 3D model in a 3D member

    Thanks very much for your help...much appreciated
    naddasmiles Guest

Similar Threads

  1. does modelresource need to be in same member as model
    By dsdsdsdsd in forum Macromedia Director 3D
    Replies: 1
    Last Post: August 8th, 10:21 AM
  2. Insert model from cast member.
    By the_scripter in forum Macromedia Director 3D
    Replies: 2
    Last Post: January 11th, 01:33 AM
  3. member().model() doesn't work in JS syntax
    By Max in forum Macromedia Director 3D
    Replies: 10
    Last Post: January 5th, 01:59 AM
  4. Replies: 1
    Last Post: November 7th, 02:18 AM
  5. Applying a bitmap to an imported model
    By Rob in forum Macromedia Director 3D
    Replies: 1
    Last Post: September 24th, 01:29 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