Stevon Ritchie <[EMAIL PROTECTED]>
> I have made a vector shape on the fly with the vertexlist defined by
> the path of the dragged mouse... I would like to use this as a
> selection tool

Hi Stevon,

If I understand correctly, any sprite which intersects with the enclosed
part of the vector shape should be selected.  I can imagine two
solutions (there are doubtless others).

* An image-based solution, where you create a bitmap image of your
  vector shape, and use matte ink with the bitmap image to check for
  intersections.  You could momentarily swap the bitmap into the sprite
  which contains the vector shape, perform your matte-ink intersection
  check, then swap the vector shape back.

* A geometry-based solution where you would use the rect of the vector
  shape sprite to shortlist candidates for intersection.  You would then
  use rect and line maths to determine which of those sprites is crossed
  by one of the sides of the vector shape.  Any sprites which are
  crossed by a side will be included in your selection.  Those which are
  not are either entirely inside or entirely outside the vectorshape:
  you would need to check if an arbitrary point inside such a sprite is
  inside the vector shape.  You can find an algorithm for this
  (commented in French) at:

>>           http://perso.planetb.fr/newton/irregulier.dir

The first solution will doubtless use fewer lines of Lingo and relies on
Director's internal code to do the lion's share of the work; the second
uses Lingo that is fast.

Does this help at all?

James




[To remove yourself from this list, or to change to digest mode, go to
http://www.penworks.com/LUJ/lingo-l.cgi  To post messages to the list,
email [EMAIL PROTECTED]  (Problems, email [EMAIL PROTECTED])
Lingo-L is for learning and helping with programming Lingo.  Thanks!]

Reply via email to