intersection and ExoticaX
- Posted by Lewis Townsend <keroltarr at HOTMAIL.COM> Jul 04, 2001
- 417 views
Hello all, I thought I sent a message concerning this question already but haven't seen any responses yet so here goes again: I need a formula or an Euphoria function that can tell me where a line intersects with a polygon. I know that a line can intersect with a polygon more than once so I want the intersection that is closest to the line's starting point. Also, if it would make for faster code the line can be defined with starting point and directional vector rather than starting point and ending point. Here is a skeleton function: function IntersectPolygon( atom x, atom y, atom x2, atom y2, sequence poly ) return {x,y} -- coordinates of intersection point end function This looks like a job for Jiri Babor or any of the gurus around here. I mention Jiri simply becuase he is a master at writing fast executing code. Jiri, please don't feel obligated to write a function for me simply because I mentioned your name, I just thought this might be a pleasant challenge for you. Also I have some issues with ExoticaX that perhaps Chris Bensler can help me with. I thought I had his email saved or I wouldn't post this to the list but maybe others can help with this as well: In the ExoticaX docs gdi_get_charwodth( atom Char ) sould be:....^ gdi_get_charwidth( atom Char ) .............^ In Ddraw.ew line 921 uses a sprintf format %D instead of %d doesn't work with the captital D In creation or loading of a bitmap in ExoticaX the memory mode can be set to hardware or software memorry. what is hardware/software memory? Is it the difference between Video memory and regular RAM or RAM and virtual memory or what? I need a draw-line procedure (needs to work on bitmaps at least) draw_line_bitmap( BMP_ID, x1,y1,x2,y2, COLOR ) or draw_line_bitmap( atom BMP_ID, sequence points, atom color ) other basic drawing routines wouldn't go amiss either. 16bit colors work fine for loaded images but not for specifying color values. It seems it uses a different format for 16bit color in specifying a hex color value. For instance #888888 is a medium gray in truecolor modes. In 16 bit mode it is a dark pink. These things aught not to be! I don't want to have to programatically test for color depth and then convert to a different color value format every time I need to specify a color with a hex number. Thanks in advance for any help from anyone on either the polygon intersection problem or the ExoticaX issues.