SlideShare a Scribd company logo
SWF2JS
Swfのベクターを分解してcanvasに出力
挫折① -> FillStyle
http://codeazur.com.br/fitc/HackingSWF.pdf
参考サイト
fillStyle1
進行方向右側の塗り
fillStyle0
進行方向左側の塗り
パーツ
描画がつながらない時は、描画を
反転するなどして、一線としてつな
げないとダメ
s
s
s
e
e e
s
se
e
挫折② -> non-zero rule
• winding ruleはnon-zeroのみがサポート
non? zero??
こんな描画をしたい
s
e
e
s
Canvasだとこうなる
non-zero rule(wiki)
A curve (top) is filled according to two rules: the even-odd rule (left), and the non-zero winding rule (right). In each
case an arrow shows a ray from a point P heading out of the curve. In the even-odd case, the ray is intersected by
two lines, an even number; therefore P is concluded to be 'outside' the curve. By the non-zero winding rule, the ray is
intersected in a clockwise direction twice, each contributing -1 to the winding score: because the total, -2, is not zero,
P is concluded to be 'inside' the curve.
In two-dimensional computer graphics, the non-zero winding rule is a means of determining whether a given point
falls within an enclosed curve. Unlike the similar even-odd rule, it relies on knowing the direction of stroke for each
part of the curve.
For a given curve C and a given point P: construct a ray (a straight line) heading out from P in any direction towards
infinity. Find all the intersections of C with this ray. Score up the winding number as follows: for every clockwise
intersection (the curve passing through the ray from left to right, as viewed from P) subtract 1; for every counter-
clockwise intersection (curve passing from right to left, as viewed from P) add 1. If the total winding number is zero, P
is outside C; otherwise, it is inside.
The winding number is effectively a count of how many full counter-clockwise revolutions ('windings') the curve
makes around P without doubling back on itself. (If P were a nail and C were a looped piece of string, try pulling
some part of the string sideways away from the nail: it will either come free, or it will be found to be wound some
number of times around the nail.) Some implementations instead score up the number of clockwise revolutions, so
that clockwise crossings are awarded +1, counter-clockwise crossings -1. The result is the same.
hai???
0の部分は描画しないらしい
+1
+1
+2
時計回りの描画を+1とし、反時計回りを-1とする。
時計回り(+1)のデータが重なる部分は2となり、描画される。
時計回り(+1)の描画と反時計回り(-1)の描画が重なる分は
0となり描画されない
fillStyle0を反転して-1の描画にする
+1 -1
+1
-1
0
0になる箇所は描画しない
時計回り
同時に描画すると…
反時計回り
挫折を乗り越えて完成
アニメーションもアクションスクリプトも
ちゃんと動く!
https://github.com/ienaga/swf2js
swf2js

More Related Content

What's hot

60967781 engineering-graphics-kings-engineering-college-qustion-papers
60967781 engineering-graphics-kings-engineering-college-qustion-papers60967781 engineering-graphics-kings-engineering-college-qustion-papers
60967781 engineering-graphics-kings-engineering-college-qustion-papersmech_manoj1986
 
Polygon clipping
Polygon clippingPolygon clipping
Polygon clipping
Vikas Sharma
 
Intersection - ENGINEERING DRAWING
Intersection - ENGINEERING DRAWINGIntersection - ENGINEERING DRAWING
Intersection - ENGINEERING DRAWING
Abhishek Kandare
 
Surface modelling
Surface modellingSurface modelling
Surface modelling
jntuhcej
 
Qb
QbQb
Unit 7 interpenetrations of solids
Unit 7 interpenetrations of solidsUnit 7 interpenetrations of solids
Unit 7 interpenetrations of solidsVagalla Reddy
 
Intersection
IntersectionIntersection
Intersection
ankit2313
 
Intersection of-solids-guidance
Intersection of-solids-guidanceIntersection of-solids-guidance
Intersection of-solids-guidance
sigdelsandes
 
Finding the slope of a line edmodo
Finding the slope of a line edmodoFinding the slope of a line edmodo
Finding the slope of a line edmodoshumwayc
 
intersections_of_solids
 intersections_of_solids intersections_of_solids
intersections_of_solids
dean dundas
 
Engineering graphics intersection
Engineering graphics   intersectionEngineering graphics   intersection
Engineering graphics intersectionPranav Kulshrestha
 
Projection of hexagonal pyramid step by step by process
Projection of hexagonal pyramid step by step by processProjection of hexagonal pyramid step by step by process
Projection of hexagonal pyramid step by step by processProf. S.Rajendiran
 
Slope of Line
Slope of LineSlope of Line
Overlay Stitch Meshing
Overlay Stitch MeshingOverlay Stitch Meshing
Overlay Stitch MeshingDon Sheehy
 

What's hot (16)

60967781 engineering-graphics-kings-engineering-college-qustion-papers
60967781 engineering-graphics-kings-engineering-college-qustion-papers60967781 engineering-graphics-kings-engineering-college-qustion-papers
60967781 engineering-graphics-kings-engineering-college-qustion-papers
 
Polygon clipping
Polygon clippingPolygon clipping
Polygon clipping
 
Intersection - ENGINEERING DRAWING
Intersection - ENGINEERING DRAWINGIntersection - ENGINEERING DRAWING
Intersection - ENGINEERING DRAWING
 
Surface modelling
Surface modellingSurface modelling
Surface modelling
 
Symmetry
SymmetrySymmetry
Symmetry
 
Qb
QbQb
Qb
 
Unit 7 interpenetrations of solids
Unit 7 interpenetrations of solidsUnit 7 interpenetrations of solids
Unit 7 interpenetrations of solids
 
Intersection
IntersectionIntersection
Intersection
 
Intersection of-solids-guidance
Intersection of-solids-guidanceIntersection of-solids-guidance
Intersection of-solids-guidance
 
Finding the slope of a line edmodo
Finding the slope of a line edmodoFinding the slope of a line edmodo
Finding the slope of a line edmodo
 
intersections_of_solids
 intersections_of_solids intersections_of_solids
intersections_of_solids
 
Mel110 part3
Mel110 part3Mel110 part3
Mel110 part3
 
Engineering graphics intersection
Engineering graphics   intersectionEngineering graphics   intersection
Engineering graphics intersection
 
Projection of hexagonal pyramid step by step by process
Projection of hexagonal pyramid step by step by processProjection of hexagonal pyramid step by step by process
Projection of hexagonal pyramid step by step by process
 
Slope of Line
Slope of LineSlope of Line
Slope of Line
 
Overlay Stitch Meshing
Overlay Stitch MeshingOverlay Stitch Meshing
Overlay Stitch Meshing
 

Recently uploaded

PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
ControlCase
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
Prayukth K V
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Product School
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
James Anderson
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
Safe Software
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
ThousandEyes
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
Cheryl Hung
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Inflectra
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
Dorra BARTAGUIZ
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
DianaGray10
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
Frank van Harmelen
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Albert Hoitingh
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
91mobiles
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
Product School
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
Ana-Maria Mihalceanu
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
Jemma Hussein Allen
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
KatiaHIMEUR1
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
Guy Korland
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
Sri Ambati
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
Product School
 

Recently uploaded (20)

PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
 

「swf2js」swfのベクターを分解してcanvasに出力