Do i need anything else besides this method?
Type: Posts; User: wtosh
Do i need anything else besides this method?
http://i.imgur.com/f4ANQ.png
I think I will implement this design.
Uhhhh, I don't have one yet.
Using the compare method? I guess?
Yes, that is considered an edge.
If the edge is parallel to the clipping edge, it is unchanged.
---------- let's say this is a polygon edge. and +++++++++ this is the clipping edge.
Before...
A and B are both given, I think. THe objects on the left are the left part of a edge that is of the polygon. I don't know how will the clip line intersects the edge......
--- Update ---
"the...
A and B are both given, I think. THe objects on the left are the left part of a edge that is of the polygon. I don't know how will the clip line intersects the edge......
My thoughts are that:
check left edge first. start at A, checks if clip line intersect edge A to B.
if it does make new vertice, save new verticie to A. Check next edge.
Repeat progress if...
The part where you have to intersect the polygon and create the new vertices.
So let's say the polygon edge that needs to be clipped hits the other polygon.
2. Intersection happens.
How can I...
I can't seem to convert the design into code.
I have a design, it's written in my notebook.
The ClipTest, extendedCanvas, simpleCanvas were all classes provided by my instructor. I am NOT to modify them. The class I am able to change is the clipper.java class which came empty with the zip...
This is a whole assignment with rectangles and complicated polygon. This is also our one and only clipping assignment well.
That's what i'm trying to do. Clip many sided polygons
Well my professor taught us what clipping means but the thing is that I don't know how to implement it into code.
I don't know how one polygon clips another is what i'm saying. The clipPolygon() should return the new vertices.
isInside is always true because there is no clipBorder value to compare it too?
The...
I believe there is 2 types of polygons. I am using to clip with and the other is the polygon i need to clip. How am i suppose to clip with that polygon, I believe it's the x0,x1,y0,y1.
As for the...
How would I do the intersect method? If clipBorder isn't working for me.
The printed vaubles does not tell me what's going on. The intersectx and y are always 0 since i never instaniated that. LyxCxy are always changing.
//
// Clipper.java
//
//
/**
* Object for performing clipping
*
*/
//
// Clipper.java
//
//
// Created by Joe Geigel on 1/21/10.
// Copyright 2010 __MyCompanyName__. All rights reserved.
//
/**
* Object for performing clipping
It's suppose to clip the polygons so it's half shaded. The image is the results.
I did do the println() and it didn't help me to figure out why it's always true.
sweet, i'll try it.
--- Update ---
Alright, the condition is always true, it seems. Do you have any ideas how to fix this algorithm then?
I'm trying to clip out of some of the parts in each polygon. I'm stuck on that and I been debugging since this post but somehow my method isIntersect isn't being called/used. What I have now is all...
What am I doing wrong?