dragging a small texture around a HUGE plane

Ask a Question related to Macromedia Director 3D, Design and Development.

  1. #1

    Default dragging a small texture around a HUGE plane

    I'm trying to get a small texture to be able to be dragged around a huge plane
    by the user.

    I can move the texture using this line:
    member("Scene2").shader("planeShader").TextureTran sformList[2].position =
    vector( 0.52000, 0.35000, 0.00 )

    and I thought I could substitute the vector at the end of the line with the
    one generated by:

    sprite(2).camera.spriteSpaceToWorldSpace(point(the mouseH, the mouseV))

    but the vector values needed have to be between -1 and 1, and the vector
    values returned are between
    -- vector( 415.64, 105.08, -601.04 )
    and
    -- vector( 1016.63, 324.66, -162.84 )

    how do the returned vectors from "spriteSpaceToWorldSpace" relate to the
    object in the 3D world, under the mouse lolcation?

    or am i going about this the wrong way (to drag a small texture round a plane)

    Any help greatfully received
    Jez.

    Jez C Guest

  2. Similar Questions and Discussions

    1. Moving a texture layer around a plane
      Hi I've got 2 textures on a plane, 1) the base texture repeated all over the plane, 2) a bitmap with a circular alpha channel i want to be...
    2. Plane only shows texture on one side
      Hi, I've created a plane with lingo and rotated it so it's on end. The plane has a texture mapped to it but the texture only shows on one side, the...
    3. Plane Texture Problem
      Hi. My problem is simple: i work with a PLANE in 3DStudio Max, with 2-Sided Shader Texture. In the 3DSMax render looks ok in both sides, but...
    4. A portion of a texture/plane transparent...?
      I?m wondering if there?s a way to define an area of a texture or plane as transparent? Yes I know that using an image with an alpha channel can do...
    5. just trying to make my shader's texture not squish to fit the plane..
      I thought I already knew how to do this, but I can't seem to get it to work.. I have 3d planes and I'd like to display a texture on them, made from...
  3. #2

    Default Re: dragging a small texture around a HUGE plane

    What you probably want to use is modelsUnderLoc(). When using the #detailed
    flag, it returns a list of models under a 2D sprite-relative point (which can
    be the cursor location). Check out the documentation on this method.

    Then use the #detailed info to determine if/where on the plane the cursor is
    intersecting. The property is iSectPosition. Use the vector derived from
    iSectPosition to determine your UV coordinates for the texture (probably just
    multiply it times a float to get it scaled properly).

    I used this basic procedure to drag models onto a plane, but the concept
    should apply to texture coordinates also. Though note it can get tricky when
    you drag the cursor off the sprite/stage/window, when to stop dragging, etc.
    You need to setup all those little caveats.

    tedalde2 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