Sunset Lake Software - Comments for "question about gltranslate, glscale and molecules" http://www.sunsetlakesoftware.com/forum/question-about-gltranslate-glscale-and-molecules Comments for "question about gltranslate, glscale and molecules" en Thanks Brad. Well I'm not http://www.sunsetlakesoftware.com/forum/question-about-gltranslate-glscale-and-molecules#comment-907 <p>Thanks Brad. Well I'm not sure how to get the triangle count with the sdk, but in Max the face count (in this case a mesh-triangles not polys) is 44k.</p> pubDate Thu, 24 Feb 2011 23:42:47 +0000 dc:creator blamejane guid false comment 907 at http://www.sunsetlakesoftware.com How high is high in regards http://www.sunsetlakesoftware.com/forum/question-about-gltranslate-glscale-and-molecules#comment-906 <p>How high is high in regards to the triangle count? In my benchmarks, the original iPhone can push around 420,000 triangles / s in my Molecules application, with the iPhone 4 and iPad coming in around 1,800,000 triangles / s. This is with simple smooth shading and a single light source, so texturing and other additions will probably reduce these rendering rates.</p> <p>Still, that's a lot of triangles that you can use for your geometry. Beyond that, I'm working on some interesting things in OpenGL ES 2.0 that let the shaders do some of the work that you normally needed complex geometry for. There are plenty of ways to fool the eye.</p> pubDate Wed, 23 Feb 2011 17:00:46 +0000 dc:creator Brad Larson guid false comment 906 at http://www.sunsetlakesoftware.com Thanks very much for the http://www.sunsetlakesoftware.com/forum/question-about-gltranslate-glscale-and-molecules#comment-905 <p>Thanks very much for the detailed response Brad. I hope that I can make the same changes. I'm encouraged by your success at turning molecules out after 3 weeks of learning, but I'm past that and it's still a bit confusing. I'm going to read your detailed explanation for replacing the glx() functions with equivalent matrix manipulations and see what I can learn. Prior to reading it though, I will say that I have the pan/zoom/rotate all working the way I want, though the pan is very jumpy. I suspect its happening when I pan diagonally and the model is transforming first on y value then on x value, making it appear to jump a little. </p> <p>In any case, I'm developing my app for the iPad, but I'd like it to then port to iphones. I'm thinking like you that I should be looking to port to opengles 2.0. </p> <p>Do you think it matters that my model is very high in poly count? It's a model of a sculpted rocking chair built in 3ds max and exported using PoverVR sdk to a POD file.</p> <p>Thanks again.</p> <p>Valerie</p> pubDate Tue, 22 Feb 2011 18:04:24 +0000 dc:creator blamejane guid false comment 905 at http://www.sunsetlakesoftware.com Yes, I replaced all of the http://www.sunsetlakesoftware.com/forum/question-about-gltranslate-glscale-and-molecules#comment-903 <p>Yes, I replaced all of the glTranslate() and glScale() functions with equivalent matrix manipulations through CATransform3D since the launch of the application. The reasons I did so are detailed <a href="http://www.sunsetlakesoftware.com/2009/01/13/opengl-es-catransform3d" rel="nofollow">here</a>.</p> <p>Basically, in order to manipulate the model view matrix in a way that would allow me to rotate the model properly in response to use input, I had to know the current state of that matrix at each frame. The initial way I did this was to read the model view matrix back before performing the rotation and scaling operations. This led to performance degradation because the rendering pipeline was halted every time I read back the current state.</p> <p>Instead, I chose to use the Core Animation helper functions to manipulate my own copy of the model view matrix, then write out the result of these operations every frame. A CATransform3D struct has the same internal structure as a model view matrix, and the operations used in Core Animation do the same math as glRotate(), etc., so I could save having to write these operations myself by leveraging stuff built into iOS. That's why you see me using those methods.</p> <p>It turned out to be a good decision, because now that I'm moving to OpenGL ES 2.0 (which lacks an explicit model view matrix and the functions that deal with it like glRotate()), I need to do these calculations myself anyways.</p> pubDate Mon, 21 Feb 2011 20:24:39 +0000 dc:creator Brad Larson guid false comment 903 at http://www.sunsetlakesoftware.com