Search Results

Search found 22128 results on 886 pages for 'point in polygon'.

Page 11/886 | < Previous Page | 7 8 9 10 11 12 13 14 15 16 17 18  | Next Page >

  • How do I convert a partially transparent image into polygons?

    - by user82779
    I'm using GLEE2D, a level editor allowing me to import images, scale them, rotate them, and position them onto layers and export the data into XML format. However, it does not tell me objects' boundaries. I can calculate them, but only given the original image's polygons. How do I get polygons of objects in a transparent image? An example object (I outlined it): How would I turn the object, knowing the scaled size of the image, into polygons? Is there an algorithm for this? I'll use OpenGL to draw them.

    Read the article

  • MySql Geospatial bug..?

    - by ShaChris23
    This question is for Mysql geospatial-extension experts. The following query doesn't the result that I'm expecting: create database test_db; use test_db; create table test_table (g polygon not null); insert into test_table (g) values (geomfromtext('Polygon((0 5,5 10,7 8,2 3,0 5))')); insert into test_table (g) values (geomfromtext('Polygon((2 3,7 8,9 6,4 1,2 3))')); select X(PointN(ExteriorRing(g),1)), Y(PointN(ExteriorRing(g),1)), X(PointN(ExteriorRing(g),2)), Y(PointN(ExteriorRing(g),2)), X(PointN(ExteriorRing(g),3)), Y(PointN(ExteriorRing(g),3)), X(PointN(ExteriorRing(g),4)), Y(PointN(ExteriorRing(g),4)) from test_table where MBRContains(g,GeomFromText('Point(3 6)')); Basically we are creating 2 Polygons, and we are trying to use MBRContains to determine whether a Point is within either of the two polygons. Surprisingly, it returns both polygons! Point 3,6 should only exist in the first inserted polygon. Note that both polygons are tilted (once you draw the polygons on a piece of paper, you will see) How come MySql returns both polygons? I'm using MySql Community Edition 5.1.

    Read the article

  • Drawing and filling different polygons at the same time in MATLAB

    - by Hossein
    Hi,I have the code below. It load a CSV file into memory. This file contains the coordinates for different polygons.Each row of this file has X,Y coordinates and a string which tells that to which polygon this datapoint belongs. for example a polygone named "Poly1" with 100 data points has 100 rows in this file like : Poly1,X1,Y1 Poly1,X2,Y2 ... Poly1,X100,Y100 Poly2,X1,Y1 ..... The index.csv file has the number of datapoint(number of rows) for each polygon in file Polygons.csv. These details are not important. The thing is: I can successfully extract the datapoints for each polygon using the code below. However, When I plot the lines of different polygons are connected to each other and the plot looks crappy. I need the polygons to be separated(they are connected and overlapping the some areas though). I thought by using "fill" I can actually see them better. But "fill" just filles every polygon that it can find and that is not desirable. I only want to fill inside the polygons. Can someone help me? I can also send you my datapoint if necessary, they are less than 200Kb. Thanks [coordinates,routeNames,polygonData] = xlsread('Polygons.csv'); index = dlmread('Index.csv'); firstPointer = 0 lastPointer = index(1) for Counter=2:size(index) firstPointer = firstPointer + index(Counter) + 1 hold on plot(coordinates(firstPointer:lastPointer,2),coordinates(firstPointer:lastPointer,1),'r-') lastPointer = lastPointer + index(Counter) end

    Read the article

  • Finding the contact point with SAT

    - by Kai
    The Separating Axis Theorem (SAT) makes it simple to determine the Minimum Translation Vector, i.e., the shortest vector that can separate two colliding objects. However, what I need is the vector that separates the objects along the vector that the penetrating object is moving (i.e. the contact point). I drew a picture to help clarify. There is one box, moving from the before to the after position. In its after position, it intersects the grey polygon. SAT can easily return the MTV, which is the red vector. I am looking to calculate the blue vector. My current solution performs a binary search between the before and after positions until the length of the blue vector is known to a certain threshold. It works but it's a very expensive calculation since the collision between shapes needs to be recalculated every loop. Is there a simpler and/or more efficient way to find the contact point vector?

    Read the article

  • GoogleMaps API draw polygon over a complete town

    - by Frank
    Hello SOers, I'm wondering if it's actually possible to draw a polygon over a complete town with the GoogleMaps API V3 or the V2? If so could you please give an example on how to do it (choose your favorite town :)). I've some difficulties understanding this API. Thanks.

    Read the article

  • OpenGL Polygon Stipple Not Working On Different Machine

    - by FranticPedantic
    I have a situation where I am trying to draw a semi-transparent rectangle over a background that is not using openGL and so I can not use blending. I decided to use polygon stippling for a 'screen door transparency' effect as recommended by some. It works fine on my machine and some others, but on some machines with slightly old Intel graphics cards it's failing to render the rectangle at all. If I turn off polygon stipple, it renders fine (but without the stipple). I have compared many of the state variables that I thought might affect it (see code) between machines and they are all the same, and I get no errors. static const GLubyte stipplePatternChkr[128]; //definition omitted for clarity //but works on my machine // stipple the box glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); glColor4ubv(Color(COLORREF_PADGRAY)); glEnable(GL_POLYGON_STIPPLE); glPolygonStipple(stipplePatternChkr); CRect rcStipple(dim); rcStipple.DeflateRect(padding - 1, padding - 1); glBegin(GL_QUADS); glVertex2i(rcStipple.left, rcStipple.bottom); glVertex2i(rcStipple.right, rcStipple.bottom); glVertex2i(rcStipple.right, rcStipple.top); glVertex2i(rcStipple.left, rcStipple.top); glEnd(); glDisable(GL_POLYGON_STIPPLE); int err = glGetError(); if (err != GL_NO_ERROR) { TRACE("glError(%s: %s)\n", s, gluErrorString(err)); } float x; glGetFloatv(GL_UNPACK_ALIGNMENT, &x); TRACE("unpack alignment %f\n", x); glGetFloatv(GL_UNPACK_IMAGE_HEIGHT, &x); TRACE("unpack height %f\n", x); glGetFloatv(GL_UNPACK_LSB_FIRST, &x); TRACE("unpack lsb %f\n", x); glGetFloatv(GL_UNPACK_ROW_LENGTH, &x); TRACE("unpack length %f\n", x); glGetFloatv(GL_UNPACK_SKIP_PIXELS, &x); TRACE("upnack skip %f\n", x); glGetFloatv(GL_UNPACK_SWAP_BYTES, &x); TRACE("upnack swap %f\n", x);

    Read the article

  • Generate 2D cross-section polygon from 3D mesh

    - by nornagon
    I'm writing a game which uses 3D models to draw a scene (top-down orthographic projection), but a 2D physics engine to calculate response to collisions, etc. I have a few 3D assets for which I'd like to be able to automatically generate a hitbox by 'slicing' the 3D mesh with the X-Y plane and creating a polygon from the resultant edges. Google is failing me on this one (and not much helpful material on SO either). Suggestions?

    Read the article

  • Division to the nearest 1 decimal place without floating point math?

    - by John Sheares
    I am having some speed issues with my C# program and identified that this percentage calculation is causing a slow down. The calculation is simply n/d * 100. Both the numerator and denominator can be any integer number. The numerator can never be greater than the denominator and is never negative. Therefore, the result is always from 0-100. Right now, this is done by simply using floating point math and is somewhat slow, since it's being calculated tens of millions of times. I really don't need anything more accurate than to the nearest 0.1 percent. And, I just use this calculated value to see if it's bigger than a fixed constant value. I am thinking that everything should be kept as an integer, so the range with 0.1 accuracy would be 0-1000. Is there some way to calculate this percentage without floating point math?

    Read the article

  • How to output floating point numbers with a custom output format in C++?

    - by Victor Liu
    The problem is that I want to output Mathematica compatible floating point numbers. The only difference with the standard IOStream or printf output format is that the exponential e is replaced by *^: Standard C/C++ output format: 1.23e-4 Mathematica format: 1.23*^-4 Is there a way to manipulate streams to achieve this effect? My original idea was just to use istringstream and dump it to a string and then replace all the e's. I would also be okay if someone posted code to parse through the bits of the floating point number and output it directly (i.e. a printf("%e") replacement).

    Read the article

  • SQL SERVER – Fix : Error 3623 – An invalid floating point operation occurred

    - by pinaldave
    Going back in time, I always had a problem with mathematics. It was a great subject and I loved it a lot but I only mastered it after practices a lot. I learned that mathematics problems should be addressed systematically and being verbose is not a trick, I learned to solve any problem. Recently one of reader sent me an email with the title “Mathematics problem – please help!” and I was a bit scared. I was good at mathematics but not the best. When I opened the email I was relieved as it was Mathematics problem with SQL Server. My friend received following error while working with SQL Server. Msg 3623, Level 16, State 1, Line 1 An invalid floating point operation occurred. The reasons for the error is simply that invalid usage of the mathematical function is attempted. Let me give you a few examples of the same. SELECT SQRT(-5); SELECT ACOS(-3); SELECT LOG(-9); If you run any of the above functions they will give you an error related to invalid floating point. Honestly there is no workaround except passing the function appropriate values. SQRT of a negative number will give you result in real numbers which is not supported at this point of time as well LOG of a negative number is not possible (because logarithm is the inverse function of an exponential function and the exponential function is NEVER negative). When I send above reply to my friend he did understand that he was passing incorrect value to the function. As mentioned earlier the only way to fix this issue is finding incorrect value and avoid passing it to the function. Every mathematics function is different and there is not a single solution to identify erroneous value passed. If you are facing this error and not able to figure out the solution. Post a comment and I will do my best to figure out the solution. Reference: Pinal Dave (http://blog.sqlauthority.com) Filed under: PostADay, SQL, SQL Authority, SQL Error Messages, SQL Query, SQL Server, SQL Tips and Tricks, T SQL, Technology

    Read the article

  • how to point godaddy to my entrydns domain

    - by geminiCoder
    I have a server connected via dynamic ip. I have set up entrydns to manage the change of my ip. If I put in my entrydns url it points me to my servers current ip. I purchased a domain from go daddy, but I have been unable to get it to point to my entrydns. What I want is to be able to ssh to my server. but ideally id like to do this by using my domain name. I must confess Im a bit overwhelmed by the godaddy interface. So The bottom line is how do I point my godaddy domain to my dns domain so that when I look up the domain I get the current ip of the server?

    Read the article

  • Ubuntu 12.04 64 bit doesn't work on a win7 with check point full disk encryption

    - by Victor Rodriguez
    I installed Ubuntu 12.04 64 bit with the Wubi installer on a Windows 7 with Check Point Full Disk Encryption. The Wubi Installer runs without any trouble selecting the compatibility mode with WinXP and as Administrator. The problem is that after the installation is complete and the reboot done, when you restart the system, there's no option to start Ubuntu instead of Windows. I recently installed Ubuntu on other Win7 machines without any problem. But those laptops don't have the Check Point Full Disk Encryption. And when you restart the system you have the option to start in Ubuntu. If somebody has resolved this issue please share...!!! Regards! Víctor

    Read the article

  • Ray-plane intersection to find the Z of the intersecting point

    - by Jenko
    I have a rectangle in 3d space (p1, p2, p3, p4) and when the mouse rolls over it I need to calculate the exact Z of the point on the rect, given the mouse coordinates (x, y). Would a Ray-plane intersection find the Z of the intersecting point? Edit: Would this one-liner work? .. it returns the t value for the intersection, apparently the Z value. float rayPlane(vector3D planepoint, vector3D normal, vector3D origin, vector3D direction){ return -((origin-planepoint).dot(normal))/(direction.dot(normal)); }

    Read the article

  • Matrix rotation of a rectangle to "face" a given point in 2d

    - by justin.m.chase
    Suppose you have a rectangle centered at point (0, 0) and now I want to rotate it such that it is facing the point (100, 100), how would I do this purely with matrix math? To give some more specifics I am using javascript and canvas and I may have something like this: var position = {x : 0, y: 0 }; var destination = { x : 100, y: 100 }; var transform = Matrix.identity(); this.update = function(state) { // update transform to rotate to face destination }; this.draw = function(ctx) { ctx.save(); ctx.transform(transform); // a helper that just calls setTransform() ctx.beginPath(); ctx.rect(-5, -5, 10, 10); ctx.fillStyle = 'Blue'; ctx.fill(); ctx.lineWidth = 2; ctx.stroke(); ctx.restore(); } Feel free to assume any matrix function you need is available.

    Read the article

  • How to remove mount point not selected error?

    - by Karan H. Joshi
    I've free dos laptop with i3 processor 4gb ram nd 500gb hdd. I've installed windows 8 manually and created all partitions. My partitions are: C: Windows8 90GB NTFS D: Blank 25GB FAT32 E: Entertainment 117GB NTFS F: Other 117GB NTFS G: Software 117GB NTFS Now, I've made flash drive for Ubuntu 13.04 and want to install on D: I've tried a lot to install on that partition but every time I got error of No mount point selected. But actually I've selected / as mount point. So please help me to solve this problem. and also suggest me what to do for /home. Note: I want to access windows 8 as my main operating system.

    Read the article

  • Camera closes in on the fixed point

    - by V1ncam
    I've been trying to create a camera that is controlled by the mouse and rotates around a fixed point (read: (0,0,0)), both vertical and horizontal. This is what I've come up with: camera.Eye = Vector3.Transform(camera.Eye, Matrix.CreateRotationY(camRotYFloat)); Vector3 customAxis = new Vector3(-camera.Eye.Z, 0, camera.Eye.X); camera.Eye = Vector3.Transform(camera.Eye, Matrix.CreateFromAxisAngle(customAxis, camRotXFloat * 0.0001f)); This works quit well, except from the fact that when I 'use' the second transformation (go up and down with the mouse) the camera not only goes up and down, it also closes in on the point. It zooms in. How do I prevent this? Thanks in advance.

    Read the article

  • Setting Anchor Point

    - by Siddharth
    I want to set anchor point for the sprite like cocos2d has done for their implementation. I do not found any thing like that in andengine so please provide guidance on that. I want to move the sprite on touch so I use following code but that does not work for me. super.setPosition(pX - this.getWidthScaled() / 2, pY - this.getHeightScaled() / 2); Because I touch on the corner of the image but automatically it comes at center of the image because of above code. I want to remain the touch at desire position and drag it. For me the anchor point became useful. But I don't found anything in andengine.

    Read the article

  • How to point GoDaddy to EntryDNS domain

    - by geminiCoder
    I have a server connected via dynamic IP. I have set up EntryDNS to manage the change of my IP. If I put in my EntryDNS URL it points me to my server's current IP. I purchased a domain from GoDaddy, but I have been unable to get it to point to my EntryDNS. What I want is to be able to ssh to my server, but ideally I'd like to do this by using my domain name. I must confess I'm a bit overwhelmed by the GoDaddy interface. So the bottom line is, how do I point my GoDaddy domain to my DNS domain so that when I look up the domain I get the current IP of the server?

    Read the article

  • Point Light Soft Shadows

    - by notabene
    How to implement soft shadows for omni directional (point) light. We use typical shadow mapping technique. Depth is rendered to texture cube and addresing is pretty simple then. Just using vector from light to fragments world position. It works perfectly. Until you want soft shadows. In our engine we use PCSS technique for spot lights. But for point light there begins troubles. How to sample in 3D? I developed technique when orthonormal basis is created from a direction and upvector (0,1,0). And then multiply sampling vector (something like this (1.0,i/depthMapSize,j/depthMapSize) with this basis. But this (of course :)) looks pretty bad for vectors near (0,1,0) and (0,-1,0). I will appreciate any help on this.

    Read the article

  • A record point not working

    - by Peter
    I'm trying to do an A record point to transfer the hosting of a domain from one provider to another. I don't want to change the nameservers as this will result in emails going down. The output when I dig for the domain shows the correct IP (78.46.63.87) for the new host. I know A records can take a while to propagate but Its been over 36hrs now and I still keep getting this error(below) when I try to pull the domain through as an addon domain via Cpanel on the new host. Are the old nameservers conflicting with the A record point? here's the error: Using nameservers with the following IPs: 208.80.125.4,208.80.126.4,208.80.124.4,208.94.148.4 Sorry, the domain is already pointed to an IP address that does not appear to use DNS servers associated with this server. Please transfer the domain to this servers nameservers or have your administrator add one of its nameservers to /etc/ips.remotedns and make the proper A entries on that remote nameserver.

    Read the article

  • Set up Trendnet TEW-638APB Access point on Ubuntu 14.04

    - by Mr. Smileys
    I have a computer running Ubuntu 14.04, it has 2 Ethernet ports. I would like to set up this computer so that the internet comes in on one of the ports and is then shared through the other port with the Trendnet wireless access point that my other devices would connect to and use the internet. I have looked online for information on setting this up but have not been able to find anything. If someone could point me to a guide that would help me or just tell me how to do this in an answer I would really appreciate it. please help me to solve this problem

    Read the article

  • Le gouvernement fait un point sur l'avancement et la fiabilité d'IDéNum, son projet d'identité numér

    Mise à jour du 03.06.2010 par Katleen Le gouvernement fait un point sur l'avancement et la fiabilité d'IDéNum, son projet d'identité numérique centralisée Nathalie Kosciusko-Morizet (NKM), notre secrétaire d'État chargée de la Prospective et du Développement de l'économie numérique, a lancé en février 2010 le chantier du projet IDéNum (voir news précédente). Hier, elle avait réuni les 58 organismes partenaires de l'aventure pour une réunion de point d'étape. Parmi les organismes associés, certains souhaitent pour l'instant rester anonymes et garder leur participation secrète. Pour les autres, la liste comprend : ACSEL, AFNIC, Agorabox, Almetis, Agence nationale de la sécurité des systèmes d'informat...

    Read the article

  • Zooming to point of interest

    - by user1010005
    I have the following variables: Point of interest which is the position(x,y) in pixels of the place to focus. Screen width,height which are the dimensions of the window. Zoom level which sets the zoom level of the camera. And this is the code I have so far. void Zoom(int pointOfInterestX,int pointOfInterstY,int screenWidth, int screenHeight,int zoomLevel) { glTranslatef( (pointOfInterestX/2 - screenWidth/2), (pointOfInterestY/2 - screenHeight/2),0); glScalef(zoomLevel,zoomLevel,zoomLevel); } And I want to do zoom in/out but keep the point of interest in the middle of the screen. but so far all of my attempts have failed and I would like to ask for some help.

    Read the article

  • How do I create a WiFi hotspot sharing wireless internet connection (single adapter)?

    - by Ruppesh Nalwaya
    I know how to create a hotspot when connected to a wired network, but when I am using internet from a WiFi connection, this disconnects the wireless connection the moment I activate the hotspot. In Windows I can use Connectify Hotspot, which enables me to share the internet connection from the same wireless adapter as I am creating an access point on. As you can read on the technology overview page: Access Point mode allows you to create a hotspot using the same Wi-Fi card that you are using to access the Internet. How do I do this on Ubuntu?

    Read the article

< Previous Page | 7 8 9 10 11 12 13 14 15 16 17 18  | Next Page >