Search Results

Search found 9 results on 1 pages for 'sum1stolemyname'.

Page 1/1 | 1 

  • Find unique vertices from a 'triangle-soup'

    - by sum1stolemyname
    I am building a CAD-file converter on top of two libraries (Opencascade and DWF Toolkit). However, my question is plattform agnostic: Given: I have generated a mesh as a list of triangular faces form a model constructed through my application. Each Triangle is defined through three vertexes, which consist of three floats (x, y & z coordinate). Since the triangles form a mesh, most of the vertices are shared by more then one triangle. Goal: I need to find the list of unique vertices, and to generate an array of faces consisting of tuples of three indices in this list. What i want to do is this: //step 1: build a list of unique vertices for each triangle for each vertex in triangle if not vertex in listOfVertices Add vertex to listOfVertices //step 2: build a list of faces for each triangle for each vertex in triangle Get Vertex Index From listOfvertices AddToMap(vertex Index, triangle) While I do have an implementation which does this, step1 (the generation of the list of unique vertices) is really slow in the order of O(n!), since each vertex is compared to all vertices already in the list. I thought "Hey, lets build a hashmap of my vertices' components using std::map, that ought to speed things up!", only to find that generating a unique key from three floating point values is not a trivial task. Here, the experts of stackoverflow come into play: I need some kind of hash-function which works on 3 floats, or any other function generating a unique value from a 3d-vertex position.

    Read the article

  • Multilangual Unicode rendering in opengl

    - by sum1stolemyname
    Hi Folks, I have to extend an OpenGL-Rendering System to support international characters (especially Hebrew, Arabic and cyrillic). Development Platform is Windows(XP|Vista|7), Alas using Embercardero Delphi 2010. I currently use wglOutLineFont(...) to build my font's display list and glCallLists(length(m_Text), UNSIGNED_SHORT, PWchar(m_Text) ) to render my strings. While this is feasable for Latin-1 Characters, building the full unicode character set in advanced is pretty time-consuming (about 8.5 minutes on my machine), so i am looking for a more efficient solution. I thought about limiting the range from u+0020 - u+077f (latin, greek, cyrillic, arbaic and hebrew) to include just the glyphs i need, but that would just be a solution for my current needs, and will become insufficent once other encoding is needed. On the upside, i do not have to worry about left-to right or right-to left direction as our application can handle this already. I would expect this to be a well-known problem, so i would like to ask if there is any reference material on this on the web, or if you could share some insight on this?

    Read the article

  • Howto project a planar polygon on a plane in 3d-space

    - by sum1stolemyname
    I want to project my Polygon along a vector to a plane in 3d Space. I would preferably use a single transformation matrix to do this, but I don't know how to build a matrix of this kind. Given the plane's parameters (ax+by+cz+d), the world coordinates of my Polygon. As stated in the the headline, all vertices of my polygon lie in another plane. the direction vector along which to project my Polygon (currently the polygon's plane's normal vector) goal -a 4x4 transformation matrix which performs the required projection, or some insight on how to construct one myself

    Read the article

  • Detecting a stale Mutex

    - by sum1stolemyname
    Is there any technique or tool available to detect this kind of a deadlock during runtime? picture this in a worker thread (one of several, normally 4-6) try WaitForSingleObject(myMutex); DoSTuffThatMightCauseAnException; Except ReleaseMutex(myMutex); end; or more generally is there a design-pattern to avoid these kind of bugs? I coded the above code in the little hous after a longer hacking run

    Read the article

  • About enumerations in Delphi and c++ in 64-bit environments

    - by sum1stolemyname
    I recently had to work around the different default sizes used for enumerations in Delphi and c++ since i have to use a c++ dll from a delphi application. On function call returns an array of structs (or records in delphi), the first element of which is an enum. To make this work, I use packed records (or aligned(1)-structs). However, since delphi selects the size of an enum-variable dynamically by default and uses the smallest datatype possible (it was a byte in my case), but C++ uses an int for enums, my data was not interpreted correctly. Delphi offers a compiler switch to work around this, so the declaration of the enum becomes {$Z4} TTypeofLight = ( V3d_AMBIENT, V3d_DIRECTIONAL, V3d_POSITIONAL, V3d_SPOT ); {$Z1} My Questions are: What will become of my structs when they are compiled on/for a 64-bit environment? Does the default c++ integer grow to 8 Bytes? Are there other memory alignment / data type size modifications (other than pointers)?

    Read the article

  • How to implement automatic replacement of typos in Delphi2010

    - by sum1stolemyname
    I am looking for a way to develop a plugin for Delphi 2010IDE and have yet to find any information on that topic, not even on how to get started. What I want to accomplish is some kind of auto-spellchecker wich can be given a list of common typos (flase instead of false, .cerate instead of .create and the like) and replace them with the intended word. Do you know of a tutorial on plugin development, or maybe an open source plugin which i could base my work on?

    Read the article

  • Elegant way to distinct Path or Entry key

    - by sum1stolemyname
    I have an application loading CAD data (Custom format), either from the local filesystem specifing an absolute path to a drawing or from a database. Database access is realized through a library function taking the drawings identifier as a parameter. the identifiers have a format like ABC 01234T56-T, while my paths a typical windows Paths (eg x:\Data\cadfiles\cadfile001.bin). I would like to write a wrapper function Taking a String as an argument which can be either a path or an identifier which calls the appropriate functions to load my data. Like this: Function CadLoader(nameOrPath : String):TCadData; My Question: How can I elegantly decide wether my string is an idnetifier or a Path to a file? Use A regexp? Or just search for '\' and ':', which are not appearing in the Identifiers?

    Read the article

1