Professional Web Applications Themes

modelUnderLoc problems - Macromedia Director 3D

Ok, Im using this simple script to determine the name of the model im clicking on- easy peasy! on mouseUp pt = the mouseLoc - point(sprite(5).left, sprite(5).top) m = sprite(5).camera.modelUnderLoc(pt) put m end The problem Im faced with is that the 3d object is fairly complex- using modelUnderLoc gets very sluggish as soon as I click on areas that have several overlapping models! There are only a few actual models i need to react to modelUnderLoc (hotspots). Is there anything I can do to better increase this performance?...

Sponsored Links
  1. #1

    Default modelUnderLoc problems

    Ok, Im using this simple script to determine the name of the model im clicking
    on- easy peasy!

    on mouseUp
    pt = the mouseLoc - point(sprite(5).left, sprite(5).top)
    m = sprite(5).camera.modelUnderLoc(pt)
    put m
    end

    The problem Im faced with is that the 3d object is fairly complex- using
    modelUnderLoc gets very sluggish as soon as I click on areas that have several
    overlapping models!

    There are only a few actual models i need to react to modelUnderLoc
    (hotspots). Is there anything I can do to better increase this performance?

    Sponsored Links
    otterman Guest

  2. #2

    Default Re: modelUnderLoc problems

    Use modelsUnderLoc() instead of modelUnderLoc(), and use a parameter list.
    Check out the HELP on it. MUL tests take lots of time, but using a parameter
    list with few max models, #simple detail, and a modelList, you can maximize
    performance. Your parameter list would look something like this:

    modlist = [yourScene.model("mod1"), yourScene.model("mod2")... ]
    paramlist = [#maxNumberOfModels: 1, #levelOfDetail: #simple, #modelList:
    modlist]
    modelsPicked = sprite(5).camera.modelUnderLoc(pt, paramlist)

    You might want to make your modlist and paramslist a script property and set
    it up at beginsprite time. Also, beware that MUL will only test for the models
    in your list, and ignore all others. This means that anything in front of the
    listed models will not act as a barrier to clicking; but it sounds like this is
    what you want. But you can add "barrier" models by simply adding them to your
    modlist.

    tedalde2 Guest

  3. #3

    Default Re: modelUnderLoc problems

    Hey, Ive had success and failer with this. Jumping up and down as performance
    is loads better thanks to tedalde2-credit due! The problem Im having now is
    that I cant successfuly extract the name of the model clicked on and use it for
    another command- Any suggestions?


    on mouseup

    TheModel = member("WLS scene")
    modlist =
    [TheModel.model("Hotspot1"),TheModel.model("Hotspot 2"),TheModel.model("WLSlabels
    :Hotspot3")]
    paramlist = [#maxNumberOfModels: 1, #levelOfDetail: #simple, #modelList:
    modlist]

    pt = the mouseLoc - point(sprite(1).left, sprite(1).top)

    modelsPicked = sprite(1).camera.modelsUnderLoc(pt, paramlist)

    if modelspicked = [] then-----if not clicked on a model listed
    nothing
    else

    MyHotspot = modelspicked[1]

    member("WLS Scene"). MyHotspot .shader.blend = 100--------------THIS NOT
    WORKING ???????
    end if
    end

    otterman Guest

  4. #4

    Default Re: modelUnderLoc problems

    MyHotspot is a reference to the model. Just leave off the member("WLS Scene"),
    that's probably what's breaking it. You can access the clicked model name,
    MyHotspot.name, or access the shader properties, MyHotspot.shader.blend... It
    should work.

    tedalde2 Guest

  5. #5

    Default Re: modelUnderLoc problems

    Tedalde2 Bang on! Major milestone-now I can get on with some real work. Thanks for the guidence!
    otterman Guest

Similar Threads

  1. problems
    By Jeroen van vliet in forum PHP Development
    Replies: 13
    Last Post: May 13th, 06:57 PM
  2. div problems ?
    By Martin Bean in forum Macromedia Dynamic HTML
    Replies: 0
    Last Post: January 3rd, 08:57 AM
  3. modelUnderLoc
    By yogeshhungama in forum Macromedia Director 3D
    Replies: 1
    Last Post: August 31st, 04:48 PM
  4. A reverse Modelunderloc?
    By kingdegen in forum Macromedia Director 3D
    Replies: 8
    Last Post: April 20th, 03:30 PM
  5. Replies: 0
    Last Post: September 22nd, 02:18 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