fpsgamer

Members
  • Content count

    1662
  • Joined

  • Last visited

Community Reputation

856 Good

About fpsgamer

  • Rank
    Contributor
  1. How do most "kids apps" handle their graphics and interaction?  By "kids apps" I mean those tablet/mobile apps which teach kids under 5 the alphabet, colors and whatnot. They typically feature cartoony, scalable, 2D animations.   In particular, I'd like to know what their tool chains look like.   If I had to guess, it looks like the graphics and animations are prepared in an external tool and then loaded and displayed by the app. Perhaps a scripting language on top handles most of the user interactions? But I have no clue as to the specific tools and workflow used.   A broad overview would be much appreciated.   Thanks!
  2. [quote name='fpsgamer' timestamp='1318788382' post='4873171'] So much for being an archive. It looks like its unsearchable and all the forums are empty! What a shame. There was a lot of great content on the old site. Am I to believe they just scrapped it all in the switch? [/quote] Awesome, I'm starting to find some of the old stuff again Now, if we could only change the sites layout back to the old one ;)
  3. So much for being an archive. It looks like its unsearchable and all the forums are empty! What a shame. There was a lot of great content on the old site. Am I to believe they just scrapped it all in the switch?
  4. I'm an old time member, and I was wondering if the content from the old forums is preserved anywhere. Is there a link to an archive or something?
  5. [quote name='Antheus' timestamp='1296846477' post='4769654'] IMHO:[code]boost::array<boost::array<std::pair<int, int>>, 5>, 10> data;[/code] Does the same and comes fully decorated with iterators and whatnot. [/quote] In simplifying the code I guess I made the problem seem simpler than it is. Let me clarify why I didn't do what you suggested: [list][*][b]Foo[/b] actually contains more than two members, so pair doesn't cut it. Plus [b]Foo[/b] has more complex behaviors (methods) than [b]std::pair[/b][*]The arrays in [b]Baz[/b] and [b]Bar[/b] are already of type [b]boost::array[/b]. I omitted that detail for simplicity. Furthermore [b]Baz[/b] and [b]Bar[/b] have more complex behaviors than [b]boost::array[/b] alone, so I encapsulate it within distinct types.[*]I had to create my own iterator type because pages within [b]Baz[/b] are stored in arbitrary order while the records within each page are ordered. Also, only a portion of data is available in memory at a time so a read frequently require a "page in" from secondary storage. For this reason my iterator is implemented with special iteration behavior (i.e. I cant just simply walk forward through the [b]Baz[/b]'s internal buffer. Though I do use I use [b]boost::array::iterator[/b] internally wherever possible.[/list] I hope that clears up my motivations!
  6. I'm looking for some help to clean up a series of template classes. Unfortunately I'm not that great with templates so I was hoping I could get some direction on how to polish this code. Essentially, I'm wondering what template concepts I should use to make this structure more conventional. A simplified version of my code follows: [code] /* The following is a higly simplified implementation of a container "Bar" which holds a sparse sequence of ordered records compactly in memory. The full array of records are serialized and de-serialized from secondary storage. */ // A single record template<typename T, typename U> struct Foo{ T x; U y; //... }; // A page of records template<typename foo_type, std::size_t count> struct Bar{ foo_type point[count]; //... }; // Baz consists of a series of contiguous page frames which hold pages of records. // Behaves like a container similar to std::vector template<typename bar_type, std::size_t count> struct Baz{ bar_type baz[count]; //... }; // an iterator which walks over page frames template<typename baz_type, typename foo_type> struct baz_iterator : public std::iterator<std::input_iterator_tag, foo_type >{ baz_type& baz; baz_iterator(baz_type& baz) : baz(baz){} //... }; int main(){ Baz< Bar< Foo< int, int >, 5>, 10> b; baz_iterator<Baz< Bar< Foo< int, int >, 5>, 10> > iter(; //... } [/code] [list][*]The first thing I notice is that specifying all the template parameters for [b]Baz[/b] looks very messy. I notice I can hide that mess using a few typedefs, but is there a more conventional template idiom I can use to clean this up?[*]Is there a way to enforce, for example, that [b]Bar[/b] can only accept [b]Foo<T, U>[/b] as a template parameter? Similarly can I enforce that [b]Baz[/b] can only accept [b]Bar<Foo<T, U>, std::size_t>[/b] as a template parameter? And so on. Is this even worthwhile to enforce? How would I even do it? Partial template specialization?[*]When [b]baz_iterator[/b] inherits iterator traits I have to specify [b]baz_type[/b] [i]and[/i] [b]foo_type[/b], is there a way to infer [b]foo_type[/b] [i]from[/i] [b]baz_type[/b]?[*]Free free to highlight any other improvements I can make to make this implementation more conventional! [/list]
  7. Programming FML

    Quote:Original post by shurcool Quote:Original post by ToohrVyk The bug is that the GetNextFloat function exists in the first place [wink] What function would you recommend to use instead? You could perhaps define operator<<() (the extraction operator) with a KMath::CVector3 on the left-hand-side and istream on the right-hand-side. e.g. vertices[vertI].mLocation << fileStream; *edit* I've messed up some minor points in my suggestion. For instance I said extraction operator when I actually used the insertion operator, which is slightly counter intuitive anyways. As usual, ToohrVyk's explanation following my post covers this topic better than I have :) [Edited by - fpsgamer on January 4, 2011 12:30:25 PM]
  8. I'm working on an OpenGL application, and I began to wonder how other people design their drawable objects. For example, what data do you like to supply to these objects? In what format? For example: Model to World matrix, camera orientation vectors (up, lookat, eye), bounding box? What do your interfaces look like? Do you make heavy use of inheritance, or do you prefer composition. Discuss :)
  9. I make this possible in a vertex shader by sending a lot of duplicate data. I define an edge by four vertices <v0, v1, v2, v3>. The line segment <v0, v1> is the actual line that we want to draw, v2, is the third vertex in the first triangle, and v3 is the third vertex in the triangle which shares the edge <v0, v1>. Storing four these four values gives me the connectivity information I need to calculate face normals which I then use for silhouette determination. I'm drawing lines, so I insert each set <v0, v1, v2, v3> twice into my index buffer. The beginning of a line segment starts at v0, and the end of the line segment ends at v1. I determine which point to transform (v0 or v1) based on whether gl_VertexID is a multiple of two or not (ie. it is the beginning of the line segment, or the end of the line segment). This is what my shader looks like. I'm coloring silhouette edges right now for debugging purposes. My results are incorrect, but are visually only slightly off. attribute vec4 v0; attribute vec4 v1; attribute vec4 v2; attribute vec4 v3; void main() { vec3 s0 = vec3(v2-v0); vec3 s1 = vec3(v1-v0); vec3 s2 = vec3(v3-v0); vec3 n0 = gl_NormalMatrix * cross(s0, s1); vec3 n1 = gl_NormalMatrix * cross(s1, s2); bool keep = ( sign(n0.z) != sign(n1.z) ); if(mod(gl_VertexID, 2.0)==0.0){ if(keep){ gl_FrontColor = vec4(0.0, 0.0, 1.0, 1.0); gl_Position = gl_ProjectionMatrix * gl_ModelViewMatrix * v0; }else{ gl_FrontColor = vec4(1.0, 0.0, 0.0, 1.0); gl_Position = gl_ProjectionMatrix * gl_ModelViewMatrix * v0; } }else{ if(keep){ gl_FrontColor = vec4(0.0, 0.0, 1.0, 1.0); gl_Position = gl_ProjectionMatrix * gl_ModelViewMatrix * v1; }else{ gl_FrontColor = vec4(1.0, 0.0, 0.0, 1.0); gl_Position = gl_ProjectionMatrix * gl_ModelViewMatrix * v1; } } }
  10. I'm having some issues with a vertex shader I'm writing. I'm pretty sure the way I'm representing the data is correct/sensible, so I'm hoping someone can help verify my logic. To begin we define a silhouette edge as an edge that is shared between a front facing and a back facing triangle. What I do in my shader is transform the 4 points that belong to the two triangles by the modelview matrix (I store additional vertex attributes that make connectivity information accessible). Then I calculate the face normals for the two triangles. To check if the edge is a silhouette edge I'm checking to see if the signs of the z components of the two normals differ (ie. one is +z and one is -z in camera space). Is my math/logic correct? [Edited by - fpsgamer on November 21, 2009 5:25:51 PM]
  11. I want to be able to annotate a 3d model with billboards, but I cant seem to figure out the transformations to make it work. In other words, I want a billboard that can be "tacked" to a vertex on a model, move as the model is moved, but always face the camera. Thanks.
  12. I am creating a progress bar that I want to be some hue of green or red depending on its value. Currently I build a color map by linearly interpolating between green and red in RGB space. Here is some pseudo code illustrating my process: int r = 0; int g = 255; int b = 0; for(int i = 0; i < 255; ++i) colorMap[i] = color(r+t, g-t, b); I'm not pleased with the visual results. For example, the values in the middle are a muddy dark green. Are there any ideas on how I can achieve more "pleasing" results? Can I get more interesting results by using different color spaces?
  13. I've been playing guitar for more than a year now and I want to join a forum where I can ask music theory questions. I already know about ultimate-guitar.com, but I frankly find the average user to be a little annoying :-/ Can anyone recommend a good site with friendly smart people? Sort of like Gamedev, but for music :)
  14. I have a vague idea of what I want to achieve, but I don't know the name of the technique I'm looking for.... Lets say I have a volume texture where I only have values for certain positions <x,y,z>, the rest of the positions are uninitalized. Assuming a uniform distribution, what methods can I use to interpolate values for the rest of the volume based on the known values? eg. +---+---+---+ | ? | ? | ? | +---+---+---+ | 7 | ? | 5 | +---+---+---+ | 8 | 4 | ? | +---+---+---+
  15. In the Obj model format, texture coordinates can have 1, 2 or 3 components. I previously assumed the 3 component coordinate was for a 3d texture, but it seems that it is actually a specific type of 2d texture. From what I've read its called uvw mapping. One other source I read describes w as being "a value for the depth of the texture" (I have no idea what that is supposed to mean). I haven't been able to find much more information than that. I'm not sure how to use these coordinates properly. Do I convert uvw->uv somehow? Can OpenGL understand uvw coordinates?