Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

How to combine, punch, intersect shapes with AS3

Engaged ,
Jan 03, 2011 Jan 03, 2011

Looking for any info on how to determine the overlap of two shapes created with AS3, and preform the usual shape manipulations on them, like combining the two shapes together to create a new shape, punching the overlapping shape out of the underlying shape, or creating the intersecting shape from the two objects. Any info would be appreciated.

Thanks!

-Ted

TOPICS
ActionScript
9.5K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 03, 2011 Jan 03, 2011

the draw() method of the bitmapdata class allows you to combine displayobjects.  use the blendmode parameter to control how they're combined.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Jan 03, 2011 Jan 03, 2011

Interesting,..

Unfortunately what I need to end up with are the 2D coordinates for the result shapes points.

Think a really simplified version of Illustrator:

I'm working on an app that lets the user create simple 2D vector shapes and manipulate them, with the usual scale/rotation etc, as well as editing the individual points.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 03, 2011 Jan 03, 2011

i'm not sure what you mean by "2d coordinates" but if you mean you're trying to construct a description for a general vector shape you have a lot of work in front of you.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Jan 03, 2011 Jan 03, 2011

Lol yup, thats about it. Think of a shape stored as a series of points and drawing instrucitons-- like the vector drawing bit in AS3. I was hoping there is a tutorial out there somewhere for 2D vector math, regardless of language, but haven't found anything yet.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 03, 2011 Jan 03, 2011
LATEST

check svg=scalable vector graphics.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines