jiapei100

Member
  • Content count

    11
  • Joined

  • Last visited

Community Reputation

129 Neutral

About jiapei100

  • Rank
    Member

Personal Information

  1. Whenever I tried to reset gamedev password, I got the following error message You must complete the entire form   However, I did fill in the entire form before password updating. Did anybody meet the same problem? and how to solve this problem?   Cheers Pei
  2. Hi, all: I'm trying to load a 3D data at http://www.visionopen.com/input_sample_sphere_radiation.dat. However, when loading, by using Java3D, I always obtain those sawtooths, please refer to file http://www.visionopen.com/input_sample_sphere_radiation.jpg If using "tecplot" (refer to http://www.tecplot.com/ ), I'm able to obtain much better result as http://www.visionopen.com/input_sample_sphere_radiation_trecplot.jpg Can anybody help to load the 3D data file "input_sample_sphere_radiation.dat" without too much sawtooths? In addition, be kind enough to leave your code as well? BTW, my code to load it is attached: gi = new GeometryInfo(GeometryInfo.POLYGON_ARRAY); gi.setCoordinates(getNodesVertices1()); int[] element = getElements(); gi.setCoordinateIndices(element); gi.setStripCounts(getStripCount1()); gi.setColors(getColor1()); gi.setColorIndices(element); Looking forward to your reply. Best Regards JIA Pei
  3. How to check "some user's topics"?

    Thank you. I found it. Thanks ... Best Regards JIA
  4. Hi, gamedev: How to check "some user's topics"? Say, if I just want to check all the topics that the user "abc" has participated in, better to separate those topics started by "abc" and those topics that "abc" followed up??? Best Regards JIA
  5. Hi, all: Urgently need your help. I met this problem long time ago and till now, I couldn't have managed to solve it. Unlike in Ubuntu 8.10, Java3D seems to be incompatible with my current Video driver in Ubuntu 9.10. I uploaded a video at [url]http://www.visionopen.com/java3d_ubuntu910.ogv[/url] As shown, Java3D is not able to erase the old leftovers whenever I move the canvas to a different place. Did anybody meet the same problem and is there a way out to eliminate this terrible problem of display? Looking forward to your kind and prompt help. Best best Regards JIA Pei
  6. Extract a texture from a random shape

    Hi, Nanoha: Thank you very much for your response. Ok, let me re-describe my requirement. Provided a convex shape A, which is composed by 100 triangles: A1, A2, ... A100; and RGB values of the 10,000 pixels inside this convex shape A have been extracted. Now, I adjusted some of the shape vertexes, which brings me a new shape B, which is composed by another 100 triangles: B1, B2, B100. These triangles are sequentially corresponding to the above 100 triangles A1, A2... A100 . Now, I would like to do a warp over the whole shape from A to B. (I think until now, OpenGL can do it. ) Finally, I would like to extract (interpolate or extrapolate) the RGB values of the corresponding 10,000 pixels inside shape B. (of course, if you show on the screen, there might be less or more pixels within shape B, but I just wonder whether there is a way in OpenGL, which may not let me do my own interpolationi or extrapolation) I'm not sure whether OpenGL has a fuction like "warp", but I happened to find in Java Advanced Image, there is a "Warp" class. I believe the following code might finish this warp task. (however, can we just don't display it to save the time??) glBegin(GL_TRIANGLES); for (i=0; i<NbOfTriangles; i++) { Vertex = Triangle[i].getVertexes(); glTexCoord2f( ??, ??); glVertex3f( Vertex[0].x, Vertex[0].y, Vertex[0].z ); glTexCoord2f( ??, ??); glVertex3f( Vertex[1].x, Vertex[1].y, Vertex[1].z ); glTexCoord2f( ??, ??); glVertex3f( Vertex[2].x, Vertex[2].y, Vertex[2].z ); } glEnd(); (Oh, yes, BTW, what should glTexCoord2f( ??, ??); refer to ?? ) Anyway, if we can do the warp using OpenGL speedily, how can we finally extracted those 10,000 pixels' RGB value? I really hope OpenGL has a very very fast method (function) to deal with this texture extraction. Looking forward to your reply. If my description is still not clear, please do let me know. Best Regards JIA
  7. Extract a texture from a random shape

    Thanks for your kind and detailed reply. Thank you !! Let me give a simple example due to my requirement. A single triangle T1 is now warped into another one T2. I sampled 1000 pixels inside triangle T1 and after warping, I still would like to have 1000 corresponding pixels within triangle T2, and those pixels' RGB values are going to be used for further calculation. Is that possible be done directly by OpenGL Render To Texture technology? If no, I've got to the interpolation one pixel after another. By the way, I don't even need the screen to show what's inside the triangle. I mean, to display everything on the screen is not a must, in order to save the computation time. In another word, I only need a kind of warp by calculation, rather than by display. I was suggested that using OpenGL should bring me faster speed, but I have been wondering how come? Can you please give me some more explanation? Thanks Best Regards JIA
  8. Extract a texture from a random shape

    Hi, All: Sorry for my stupidity. May I ask some further questions? 1) yes, to use the technology named "Render To Texture" seems to be the correct way out. However, can anybody give me a simple instruction, what is a "texture" defined in OpenGL? Is it just a "string"? Or a vector of RGB values? or something else like a data structure? 2) If a "texture" is a vector of RGB, which is attached to what's going to be rendered on the screen, will this "texture" be a fix size vector over all frames? Or, this "texture" size may change when the rendered image changes? Thank you very much. Best Regards JIA
  9. Extract a texture from a random shape

    My God, so many talents already replied!! Thank you so much !!! Yes, I'd love to make things clearer. My shape is composed by around 100 triangles, and we can even simplify this issue, the shape composed by 100 triangles is a convex shape. I'd love to know what are the pixel intensities of an image, with this shape, and store all pixel intensities in sequence (row by row, left to right) for later calculation. That is my purpose. It looks like glReadPixels should work. However, you mentioned that glReadPixels is to read the pixel value on the screen. How about if I don't display it (for speed issue) ? Is it possible for me to still read the pixels' RGB value without wasting the time on display this image ? Finally, thank all for your prompt and kind reply. Seriously thanks!!!! Cheers JIA Pei
  10. Hi, all: Say, I have an image of size 640*480, I have a random shape which is composed of around 100 triangles. I would like to extract the texture of every pixel inside this random shape. Can anybody give me a hand? Best Regards JIA Pei
  11. Hi, all: Can anybody help to afford a code patch for triangular mesh based texture mapping using OpenGL? I did investigate a bit. All what I can find on line is quads mesh based texture mapping. I coded a bit by myself, it seems that the vertex sequence to define a triangle is quite important. If you reverse the sequence of the vertexes for a triangle, you probably have a black hole for this triangle, rather than the attached texture. What's more, quads mesh based texture mapping is not an affine transform at all. I really have no idea how OpenGL deal with this kind of texture mapping, but obviously, most of the code on the internet are adopting an old technology named "morphing", which is not the real affine transform I think. Can anybody give me a clue? Best Regards JIA Pei