Ask a Question related to Ruby, Design and Development.

  1. #21

    Default Re: HELP ME

    Replace the current beginSprite() handler with the one below to create a number
    of boxes, each with a different shader. Now when you drop a color chip on a
    model, only that model's color is changed.




    on beginSprite(me) ---------------------------------------------------
    -- ACTION: Initializes properties
    --------------------------------------------------------------------

    vSprite = sprite(me.spriteNum)
    pMember = vSprite.member
    pMember.resetWorld()

    pLeft = vSprite.left
    pTop = vSprite.top

    pCamera = vSprite.camera

    vResource = pMember.newModelResource("Box", #box)

    -- Create a list of positions for 9 different box models
    vPositions = []
    vPositions.append(vector( 0, 0, 0))
    vPositions.append(vector(-60, -60, -60))
    vPositions.append(vector( 60, -60, -60))
    vPositions.append(vector(-60, 60, -60))
    vPositions.append(vector( 60, 60, -60))
    vPositions.append(vector(-60, -60, 60))
    vPositions.append(vector( 60, -60, 60))
    vPositions.append(vector(-60, 60, 60))
    vPositions.append(vector( 60, 60, 60))

    -- Create 9 different box models, each with a different shader,
    -- and disperse them
    repeat with i = 1 to 9
    vName = "Box "&i
    vModel = pMember.newModel(vName, vResource)

    vShader = pMember.newShader(vName, #standard)
    vShader.texture = VOID

    vModel.shaderList = vShader

    vModel.worldPosition = vPositions[i]
    end repeat

    -- Move the camera so we can see all the boxes
    vTransform = pCamera.transform
    vTransform.position = vector(350.0000, 200.0000, 175.0000)
    vTransform.rotation = vector(-30.0000, 64.0000, 0.0000)

    -- Create a texture to drag
    pTexture = pMember.newTexture("Overlay")
    end beginSprite

    openspark Guest

  2. #22

    Default Re: HELP ME

    Thanks, example given works great. However i come back to an earlier problem
    concerning the box dimesions. I need to edit each individual box dimesions e.g
    width , length and height. Before I created each individual box with the
    original code and changed the dimensions with this line of code:

    aResource = aMember.newModelResource("aBox", #box)

    aResource.width = 5.0
    aResource.height = 75
    aResource.length = 40

    So i had this code nine times, each one with its own name and different
    dimensions to create a room model.

    How will I use the code you given, plus state each individual box dimesions.
    Any help will be most appreciated.

    Good guess with the nine box?

    uddini Guest

  3. #23

    Default Re: HELP ME

    In the stepFrame() handler in the Drag Shader Color behavior, you can change
    the line...

    ??vShader.emissive = pColor

    ... to...

    ?? vShader.texture = pTexture

    In the demo movie this will have quite a radical effect, as the change will
    occur when you click on a color chip, not when you drop it on the model. Given
    the nature of your application, you might prefer this. If so, you will need to
    modify the behaviors so that the drag-and-drop feature is disactivated.

    openspark Guest

  4. #24

    Default Help Me

    Hello,My Name Is Jamie,And I 14 Years of Age,And Want To Take In MY Fathers
    Foot Steps in Being a Web Desighner.,. I Currently Use Dreamweaver Which Is
    Very Cool Program.anyways Im Currently Working On Websites That Needs Fourms
    ..Such As This One..If Anyone Can Gimme Info On How To Make "forums" In
    Dreamweaver I Would Appriciate It..Thanks :)

    Neron05 Guest

Posting Permissions

  • You may not post new threads
  • You may 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