<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>
<channel>
	<title>Comments on: obj2opengl: convert obj 3D models to arrays compatible with iPhone OpenGL ES</title>
	<atom:link href="http://www.heikobehrens.net/2009/08/27/obj2opengl/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.heikobehrens.net/2009/08/27/obj2opengl/</link>
	<description>11:60 p.m. - my plain thoughts</description>
	<pubDate>Fri, 12 Mar 2010 05:29:56 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.3</generator>
		<item>
		<title>By: Sergey Kopanev</title>
		<link>http://www.heikobehrens.net/2009/08/27/obj2opengl/#comment-6748</link>
		<dc:creator>Sergey Kopanev</dc:creator>
		<pubDate>Sat, 27 Feb 2010 17:33:20 +0000</pubDate>
		<guid isPermaLink="false">http://www.heikobehrens.net/?p=695#comment-6748</guid>
		<description>Heiko,

What is "Center" that script saying ?
Center: 

I have two models and i have no success draw it correctly in space.
I've tried glTranslatef to "Center" and glScalef  by "Scale by" before rendering - but my models located in space at the wrong coordinates.

How can I draw 2 models on their coordinates same as in 3dMax?

thanks,</description>
		<content:encoded><![CDATA[<p>Heiko,</p>
<p>What is &#8220;Center&#8221; that script saying ?<br />
Center: </p>
<p>I have two models and i have no success draw it correctly in space.<br />
I&#8217;ve tried glTranslatef to &#8220;Center&#8221; and glScalef  by &#8220;Scale by&#8221; before rendering - but my models located in space at the wrong coordinates.</p>
<p>How can I draw 2 models on their coordinates same as in 3dMax?</p>
<p>thanks,</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sergey Kopanev</title>
		<link>http://www.heikobehrens.net/2009/08/27/obj2opengl/#comment-6747</link>
		<dc:creator>Sergey Kopanev</dc:creator>
		<pubDate>Sat, 27 Feb 2010 16:42:58 +0000</pubDate>
		<guid isPermaLink="false">http://www.heikobehrens.net/?p=695#comment-6747</guid>
		<description>Heiko,

Thanks for answer. Do you have a plan make script working with some textures ?</description>
		<content:encoded><![CDATA[<p>Heiko,</p>
<p>Thanks for answer. Do you have a plan make script working with some textures ?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Lisa Wilkinson</title>
		<link>http://www.heikobehrens.net/2009/08/27/obj2opengl/#comment-6665</link>
		<dc:creator>Lisa Wilkinson</dc:creator>
		<pubDate>Tue, 23 Feb 2010 21:19:24 +0000</pubDate>
		<guid isPermaLink="false">http://www.heikobehrens.net/?p=695#comment-6665</guid>
		<description>Here's another example.
Maya: http://imgur.com/PVYqa.png
iPhone: http://imgur.com/FGcGs.png
Texture: http://imgur.com/ivt5J.png

and my code to draw it:

	glPushMatrix();
	glBindTexture(GL_TEXTURE_2D, textures[13]);
	glVertexPointer(3, GL_FLOAT, 0, cubeVerts);
	glTexCoordPointer(2, GL_FLOAT, 0, cubeTexCoords);
	glDrawArrays(GL_TRIANGLES, 0, cubeNumVerts);
	glPopMatrix();</description>
		<content:encoded><![CDATA[<p>Here&#8217;s another example.<br />
Maya: <a href="http://imgur.com/PVYqa.png" onclick="javascript:pageTracker._trackPageview('/outbound/comment/imgur.com');" rel="nofollow">http://imgur.com/PVYqa.png</a><br />
iPhone: <a href="http://imgur.com/FGcGs.png" onclick="javascript:pageTracker._trackPageview('/outbound/comment/imgur.com');" rel="nofollow">http://imgur.com/FGcGs.png</a><br />
Texture: <a href="http://imgur.com/ivt5J.png" onclick="javascript:pageTracker._trackPageview('/outbound/comment/imgur.com');" rel="nofollow">http://imgur.com/ivt5J.png</a></p>
<p>and my code to draw it:</p>
<p>	glPushMatrix();<br />
	glBindTexture(GL_TEXTURE_2D, textures[13]);<br />
	glVertexPointer(3, GL_FLOAT, 0, cubeVerts);<br />
	glTexCoordPointer(2, GL_FLOAT, 0, cubeTexCoords);<br />
	glDrawArrays(GL_TRIANGLES, 0, cubeNumVerts);<br />
	glPopMatrix();</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Heiko Behrens</title>
		<link>http://www.heikobehrens.net/2009/08/27/obj2opengl/#comment-6652</link>
		<dc:creator>Heiko Behrens</dc:creator>
		<pubDate>Tue, 23 Feb 2010 08:31:34 +0000</pubDate>
		<guid isPermaLink="false">http://www.heikobehrens.net/?p=695#comment-6652</guid>
		<description>Hey Lisa, can you reproduce this error with a simpler example (e.g. a cube)? I am afraid the .obj file itself has some unexpected mappings.</description>
		<content:encoded><![CDATA[<p>Hey Lisa, can you reproduce this error with a simpler example (e.g. a cube)? I am afraid the .obj file itself has some unexpected mappings.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Heiko Behrens</title>
		<link>http://www.heikobehrens.net/2009/08/27/obj2opengl/#comment-6651</link>
		<dc:creator>Heiko Behrens</dc:creator>
		<pubDate>Tue, 23 Feb 2010 08:31:12 +0000</pubDate>
		<guid isPermaLink="false">http://www.heikobehrens.net/?p=695#comment-6651</guid>
		<description>Sergey, currently the script merges all groups into a single object and can handle only one texture.</description>
		<content:encoded><![CDATA[<p>Sergey, currently the script merges all groups into a single object and can handle only one texture.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Lisa Wilkinson</title>
		<link>http://www.heikobehrens.net/2009/08/27/obj2opengl/#comment-6647</link>
		<dc:creator>Lisa Wilkinson</dc:creator>
		<pubDate>Tue, 23 Feb 2010 03:11:53 +0000</pubDate>
		<guid isPermaLink="false">http://www.heikobehrens.net/?p=695#comment-6647</guid>
		<description>Hi, 

I have been having problems getting the UV texture coordinates to work.
Here is a screen shot of what it looks like in Maya: http://imgur.com/z2Ica.png
and what it looks like on the iPhone: http://imgur.com/A1alQ.png

Does anyone know how this could be fixed?
Thanks in advance for any help</description>
		<content:encoded><![CDATA[<p>Hi, </p>
<p>I have been having problems getting the UV texture coordinates to work.<br />
Here is a screen shot of what it looks like in Maya: <a href="http://imgur.com/z2Ica.png" onclick="javascript:pageTracker._trackPageview('/outbound/comment/imgur.com');" rel="nofollow">http://imgur.com/z2Ica.png</a><br />
and what it looks like on the iPhone: <a href="http://imgur.com/A1alQ.png" onclick="javascript:pageTracker._trackPageview('/outbound/comment/imgur.com');" rel="nofollow">http://imgur.com/A1alQ.png</a></p>
<p>Does anyone know how this could be fixed?<br />
Thanks in advance for any help</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sergey Kopanev</title>
		<link>http://www.heikobehrens.net/2009/08/27/obj2opengl/#comment-6232</link>
		<dc:creator>Sergey Kopanev</dc:creator>
		<pubDate>Thu, 04 Feb 2010 18:00:32 +0000</pubDate>
		<guid isPermaLink="false">http://www.heikobehrens.net/?p=695#comment-6232</guid>
		<description>Hello, all

But what if the object 2 or more textures?
thanks.</description>
		<content:encoded><![CDATA[<p>Hello, all</p>
<p>But what if the object 2 or more textures?<br />
thanks.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mirza Garibovic</title>
		<link>http://www.heikobehrens.net/2009/08/27/obj2opengl/#comment-6226</link>
		<dc:creator>Mirza Garibovic</dc:creator>
		<pubDate>Thu, 04 Feb 2010 14:29:16 +0000</pubDate>
		<guid isPermaLink="false">http://www.heikobehrens.net/?p=695#comment-6226</guid>
		<description>Hi Heiko,

I made a small change to this so that it interleaves the vertex data in one contiguous array, according to http://developer.apple.com/iphone/library/documentation/3DDrawing/Conceptual/OpenGLES_ProgrammingGuide/Performance/Performance.html

obj2opengl.pl:
http://docs.google.com/leaf?id=0B3MMs33O0RexZDUzZDU1ZjItMjRlZi00OGQwLThkOTktN2RkYWM4MzNiMDM3&#38;hl=en

Example output (cube.h):
http://docs.google.com/leaf?id=0B3MMs33O0RexMGY0YTI0NjAtY2E1MC00MGYwLWIxM2EtMGRmYzExMzE0ODUz&#38;hl=en

Example draw (note the required stride constant):

  glVertexPointer(3, GL_FLOAT, cubeStride, cubeVerts);

  glNormalPointer(GL_FLOAT, cubeStride, cubeNormals);

  glDrawArrays(GL_TRIANGLES, 0, cubeNumVerts);</description>
		<content:encoded><![CDATA[<p>Hi Heiko,</p>
<p>I made a small change to this so that it interleaves the vertex data in one contiguous array, according to <a href="http://developer.apple.com/iphone/library/documentation/3DDrawing/Conceptual/OpenGLES_ProgrammingGuide/Performance/Performance.html" onclick="javascript:pageTracker._trackPageview('/outbound/comment/developer.apple.com');" rel="nofollow">http://developer.apple.com/iphone/library/documentation/3DDrawing/Conceptual/OpenGLES_ProgrammingGuide/Performance/Performance.html</a></p>
<p>obj2opengl.pl:<br />
<a href="http://docs.google.com/leaf?id=0B3MMs33O0RexZDUzZDU1ZjItMjRlZi00OGQwLThkOTktN2RkYWM4MzNiMDM3&amp;hl=en" onclick="javascript:pageTracker._trackPageview('/outbound/comment/docs.google.com');" rel="nofollow">http://docs.google.com/leaf?id=0B3MMs33O0RexZDUzZDU1ZjItMjRlZi00OGQwLThkOTktN2RkYWM4MzNiMDM3&amp;hl=en</a></p>
<p>Example output (cube.h):<br />
<a href="http://docs.google.com/leaf?id=0B3MMs33O0RexMGY0YTI0NjAtY2E1MC00MGYwLWIxM2EtMGRmYzExMzE0ODUz&amp;hl=en" onclick="javascript:pageTracker._trackPageview('/outbound/comment/docs.google.com');" rel="nofollow">http://docs.google.com/leaf?id=0B3MMs33O0RexMGY0YTI0NjAtY2E1MC00MGYwLWIxM2EtMGRmYzExMzE0ODUz&amp;hl=en</a></p>
<p>Example draw (note the required stride constant):</p>
<p>  glVertexPointer(3, GL_FLOAT, cubeStride, cubeVerts);</p>
<p>  glNormalPointer(GL_FLOAT, cubeStride, cubeNormals);</p>
<p>  glDrawArrays(GL_TRIANGLES, 0, cubeNumVerts);</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sergey Kopanev</title>
		<link>http://www.heikobehrens.net/2009/08/27/obj2opengl/#comment-6202</link>
		<dc:creator>Sergey Kopanev</dc:creator>
		<pubDate>Wed, 03 Feb 2010 13:31:56 +0000</pubDate>
		<guid isPermaLink="false">http://www.heikobehrens.net/?p=695#comment-6202</guid>
		<description>Thanks! Very nice script.</description>
		<content:encoded><![CDATA[<p>Thanks! Very nice script.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kjaerjakcajk</title>
		<link>http://www.heikobehrens.net/2009/08/27/obj2opengl/#comment-5832</link>
		<dc:creator>Kjaerjakcajk</dc:creator>
		<pubDate>Mon, 18 Jan 2010 01:07:52 +0000</pubDate>
		<guid isPermaLink="false">http://www.heikobehrens.net/?p=695#comment-5832</guid>
		<description>Thanks for this, very helpful.</description>
		<content:encoded><![CDATA[<p>Thanks for this, very helpful.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: iphone4</title>
		<link>http://www.heikobehrens.net/2009/08/27/obj2opengl/#comment-5441</link>
		<dc:creator>iphone4</dc:creator>
		<pubDate>Mon, 04 Jan 2010 18:17:39 +0000</pubDate>
		<guid isPermaLink="false">http://www.heikobehrens.net/?p=695#comment-5441</guid>
		<description>There is a typo:
	print OUTFILE "glTexCoordPointer(2, GL_FLOAT, 0, ".$object."TexCoords);\n"
		if $numTextrue &#62; 0;

should be:
	print OUTFILE "glTexCoordPointer(2, GL_FLOAT, 0, ".$object."TexCoords);\n"
		if $numTexture &#62; 0;

It stops glTexCoordPointer appearing in comment.

Nice script though!</description>
		<content:encoded><![CDATA[<p>There is a typo:<br />
	print OUTFILE &#8220;glTexCoordPointer(2, GL_FLOAT, 0, &#8220;.$object.&#8221;TexCoords);\n&#8221;<br />
		if $numTextrue &gt; 0;</p>
<p>should be:<br />
	print OUTFILE &#8220;glTexCoordPointer(2, GL_FLOAT, 0, &#8220;.$object.&#8221;TexCoords);\n&#8221;<br />
		if $numTexture &gt; 0;</p>
<p>It stops glTexCoordPointer appearing in comment.</p>
<p>Nice script though!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Blender &#62;&#62; OpenGL ES &#8211; Any Hope? - OOgtech.org</title>
		<link>http://www.heikobehrens.net/2009/08/27/obj2opengl/#comment-5009</link>
		<dc:creator>Blender &#62;&#62; OpenGL ES &#8211; Any Hope? - OOgtech.org</dc:creator>
		<pubDate>Sat, 19 Dec 2009 14:04:41 +0000</pubDate>
		<guid isPermaLink="false">http://www.heikobehrens.net/?p=695#comment-5009</guid>
		<description>[...] obj2OpenGL &#8211; Heiko Behrens&#8217; PERL script to convert *.obj (Alias Wavefront) to opengl. This is attractive because it loads data that OpenGL can render directly. Also it&#8217;s been designed with the iPhone/iTouch in mind. If I use this I still would like to write an automation to export my models from the blender file format to obj. It would be really nice if I could &#8216;press a button&#8217; and get all my 3D files updated at once. I guess I should try this first&#8230; [...]</description>
		<content:encoded><![CDATA[<p>[...] obj2OpenGL &#8211; Heiko Behrens&#8217; PERL script to convert *.obj (Alias Wavefront) to opengl. This is attractive because it loads data that OpenGL can render directly. Also it&#8217;s been designed with the iPhone/iTouch in mind. If I use this I still would like to write an automation to export my models from the blender file format to obj. It would be really nice if I could &#8216;press a button&#8217; and get all my 3D files updated at once. I guess I should try this first&#8230; [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Niklas</title>
		<link>http://www.heikobehrens.net/2009/08/27/obj2opengl/#comment-4712</link>
		<dc:creator>Niklas</dc:creator>
		<pubDate>Mon, 07 Dec 2009 14:22:44 +0000</pubDate>
		<guid isPermaLink="false">http://www.heikobehrens.net/?p=695#comment-4712</guid>
		<description>Hm, seem that I had forgotten to put in glMatrixMode(GL_MODELVIEW) after I set up the projection view port... So the light now seems to work...</description>
		<content:encoded><![CDATA[<p>Hm, seem that I had forgotten to put in glMatrixMode(GL_MODELVIEW) after I set up the projection view port&#8230; So the light now seems to work&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Heiko Behrens</title>
		<link>http://www.heikobehrens.net/2009/08/27/obj2opengl/#comment-4710</link>
		<dc:creator>Heiko Behrens</dc:creator>
		<pubDate>Mon, 07 Dec 2009 13:06:34 +0000</pubDate>
		<guid isPermaLink="false">http://www.heikobehrens.net/?p=695#comment-4710</guid>
		<description>Hey Niklas,

your are absolutely right. The normals will be transformed (even scaled) according to your matrix. If you are an iPhone developer have a look at the GLGravity example to learn about lights and OpenGL. Also, this tutorial seems to introduce lights and normals quite extensively: http://www.falloutsoftware.com/tutorials/gl/gl8.htm</description>
		<content:encoded><![CDATA[<p>Hey Niklas,</p>
<p>your are absolutely right. The normals will be transformed (even scaled) according to your matrix. If you are an iPhone developer have a look at the GLGravity example to learn about lights and OpenGL. Also, this tutorial seems to introduce lights and normals quite extensively: <a href="http://www.falloutsoftware.com/tutorials/gl/gl8.htm" onclick="javascript:pageTracker._trackPageview('/outbound/comment/www.falloutsoftware.com');" rel="nofollow">http://www.falloutsoftware.com/tutorials/gl/gl8.htm</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Niklas</title>
		<link>http://www.heikobehrens.net/2009/08/27/obj2opengl/#comment-4709</link>
		<dc:creator>Niklas</dc:creator>
		<pubDate>Mon, 07 Dec 2009 12:29:52 +0000</pubDate>
		<guid isPermaLink="false">http://www.heikobehrens.net/?p=695#comment-4709</guid>
		<description>Hey, great script.

I'm a complete newbie when it comes to open gl, so pardon my ignorance.

But when I create a simple object with normals, and render it all, as per your examples. If I then place a light above the object, and then rotate say a cube. It seems to me that as the cube rotates around the axis, the backside of it becomes dark when facing the light, rather then the side facing away form the light becomes dark.

Do I need to recalculate or transform the normals for the light to be correct?

I'm doing a push and pop call, then translate the cube I'm drawing. I would have thought that the face facing the light would become lighter. Isn't that what the normals are for?</description>
		<content:encoded><![CDATA[<p>Hey, great script.</p>
<p>I&#8217;m a complete newbie when it comes to open gl, so pardon my ignorance.</p>
<p>But when I create a simple object with normals, and render it all, as per your examples. If I then place a light above the object, and then rotate say a cube. It seems to me that as the cube rotates around the axis, the backside of it becomes dark when facing the light, rather then the side facing away form the light becomes dark.</p>
<p>Do I need to recalculate or transform the normals for the light to be correct?</p>
<p>I&#8217;m doing a push and pop call, then translate the cube I&#8217;m drawing. I would have thought that the face facing the light would become lighter. Isn&#8217;t that what the normals are for?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Heiko Behrens</title>
		<link>http://www.heikobehrens.net/2009/08/27/obj2opengl/#comment-4383</link>
		<dc:creator>Heiko Behrens</dc:creator>
		<pubDate>Mon, 23 Nov 2009 11:24:47 +0000</pubDate>
		<guid isPermaLink="false">http://www.heikobehrens.net/?p=695#comment-4383</guid>
		<description>Hey Jace,

could you please provide your obj file so I can try to reproduce your error?</description>
		<content:encoded><![CDATA[<p>Hey Jace,</p>
<p>could you please provide your obj file so I can try to reproduce your error?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jace</title>
		<link>http://www.heikobehrens.net/2009/08/27/obj2opengl/#comment-4370</link>
		<dc:creator>Jace</dc:creator>
		<pubDate>Sun, 22 Nov 2009 18:57:03 +0000</pubDate>
		<guid isPermaLink="false">http://www.heikobehrens.net/?p=695#comment-4370</guid>
		<description>Hi,

I wondered if you could help me. I created an object in Carrara 6 pro and exported to wavefont obj file. I ran your script and I got "Illegal division by zero at ./obj2opengl.pl line 294" I checked this and it seemed to be related to scale, so i specified -noScale and it appeared to work. However upon further inspection the header file was in fact invalid and contained nothing like the expected format, instead just a copy of the original obj file. I'm new to all of this, so forgive my ignorance but do you have any idea what I'm doing wrong?

Thanks in advance for any help

Regards</description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>I wondered if you could help me. I created an object in Carrara 6 pro and exported to wavefont obj file. I ran your script and I got &#8220;Illegal division by zero at ./obj2opengl.pl line 294&#8243; I checked this and it seemed to be related to scale, so i specified -noScale and it appeared to work. However upon further inspection the header file was in fact invalid and contained nothing like the expected format, instead just a copy of the original obj file. I&#8217;m new to all of this, so forgive my ignorance but do you have any idea what I&#8217;m doing wrong?</p>
<p>Thanks in advance for any help</p>
<p>Regards</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Heiko Behrens</title>
		<link>http://www.heikobehrens.net/2009/08/27/obj2opengl/#comment-4274</link>
		<dc:creator>Heiko Behrens</dc:creator>
		<pubDate>Tue, 17 Nov 2009 15:33:09 +0000</pubDate>
		<guid isPermaLink="false">http://www.heikobehrens.net/?p=695#comment-4274</guid>
		<description>Ryan, you can easily iterate over the verts array and collect for each dimension the min and max values. But, adding this to the output of the script would be helpful, too. Thanks for your suggestion.</description>
		<content:encoded><![CDATA[<p>Ryan, you can easily iterate over the verts array and collect for each dimension the min and max values. But, adding this to the output of the script would be helpful, too. Thanks for your suggestion.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ryan</title>
		<link>http://www.heikobehrens.net/2009/08/27/obj2opengl/#comment-4273</link>
		<dc:creator>Ryan</dc:creator>
		<pubDate>Tue, 17 Nov 2009 15:11:48 +0000</pubDate>
		<guid isPermaLink="false">http://www.heikobehrens.net/?p=695#comment-4273</guid>
		<description>Does anyone know of a good way to create simple bounding boxes using these .h files? Something as simple as creating a bounding rectangle using max and min z, x, and y values would do.

Thanks!</description>
		<content:encoded><![CDATA[<p>Does anyone know of a good way to create simple bounding boxes using these .h files? Something as simple as creating a bounding rectangle using max and min z, x, and y values would do.</p>
<p>Thanks!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Heiko Behrens</title>
		<link>http://www.heikobehrens.net/2009/08/27/obj2opengl/#comment-4201</link>
		<dc:creator>Heiko Behrens</dc:creator>
		<pubDate>Fri, 13 Nov 2009 11:36:36 +0000</pubDate>
		<guid isPermaLink="false">http://www.heikobehrens.net/?p=695#comment-4201</guid>
		<description>Hey Ivan,
did you apply execution rights to the script? http://osxfaq.com/tutorials/learningcenter/UnixTutorials/ShellScripting1/index.ws#asss</description>
		<content:encoded><![CDATA[<p>Hey Ivan,<br />
did you apply execution rights to the script? <a href="http://osxfaq.com/tutorials/learningcenter/UnixTutorials/ShellScripting1/index.ws#asss" onclick="javascript:pageTracker._trackPageview('/outbound/comment/osxfaq.com');" rel="nofollow">http://osxfaq.com/tutorials/learningcenter/UnixTutorials/ShellScripting1/index.ws#asss</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ivan</title>
		<link>http://www.heikobehrens.net/2009/08/27/obj2opengl/#comment-4200</link>
		<dc:creator>Ivan</dc:creator>
		<pubDate>Fri, 13 Nov 2009 11:32:56 +0000</pubDate>
		<guid isPermaLink="false">http://www.heikobehrens.net/?p=695#comment-4200</guid>
		<description>Sorry, I'm noob in mac, i have the next error:

-bash: ./obj2opengl.pl: Permission denied</description>
		<content:encoded><![CDATA[<p>Sorry, I&#8217;m noob in mac, i have the next error:</p>
<p>-bash: ./obj2opengl.pl: Permission denied</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: tgr</title>
		<link>http://www.heikobehrens.net/2009/08/27/obj2opengl/#comment-4178</link>
		<dc:creator>tgr</dc:creator>
		<pubDate>Thu, 12 Nov 2009 09:35:46 +0000</pubDate>
		<guid isPermaLink="false">http://www.heikobehrens.net/?p=695#comment-4178</guid>
		<description>textrue should be texture in http://www.heikobehrens.net/wp-content/uploads/2009/08/obj2opengl.txt line 451.</description>
		<content:encoded><![CDATA[<p>textrue should be texture in <a href="http://www.heikobehrens.net/wp-content/uploads/2009/08/obj2opengl.txt"  rel="nofollow">http://www.heikobehrens.net/wp-content/uploads/2009/08/obj2opengl.txt</a> line 451.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Heiko Behrens</title>
		<link>http://www.heikobehrens.net/2009/08/27/obj2opengl/#comment-4033</link>
		<dc:creator>Heiko Behrens</dc:creator>
		<pubDate>Wed, 04 Nov 2009 07:51:38 +0000</pubDate>
		<guid isPermaLink="false">http://www.heikobehrens.net/?p=695#comment-4033</guid>
		<description>&lt;code&gt;./obj2opengl.pl cube.txt -s 4&lt;/code&gt;
does the trick. try
&lt;code&gt;./obj2opengl.pl --help&lt;/code&gt;
to learn more about the options.</description>
		<content:encoded><![CDATA[<p><code>./obj2opengl.pl cube.txt -s 4</code><br />
does the trick. try<br />
<code>./obj2opengl.pl --help</code><br />
to learn more about the options.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ryan</title>
		<link>http://www.heikobehrens.net/2009/08/27/obj2opengl/#comment-4030</link>
		<dc:creator>Ryan</dc:creator>
		<pubDate>Tue, 03 Nov 2009 16:55:49 +0000</pubDate>
		<guid isPermaLink="false">http://www.heikobehrens.net/?p=695#comment-4030</guid>
		<description>Great script! I'm just wondering how to use scaling options from the command line?

Keep up the great work!

Ryan</description>
		<content:encoded><![CDATA[<p>Great script! I&#8217;m just wondering how to use scaling options from the command line?</p>
<p>Keep up the great work!</p>
<p>Ryan</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: fx61803</title>
		<link>http://www.heikobehrens.net/2009/08/27/obj2opengl/#comment-3929</link>
		<dc:creator>fx61803</dc:creator>
		<pubDate>Fri, 23 Oct 2009 21:50:56 +0000</pubDate>
		<guid isPermaLink="false">http://www.heikobehrens.net/?p=695#comment-3929</guid>
		<description>Hello!
thanks for the links, they've been helpful
now, I couldn't make the texturing of your banana to work, but it seems it required a call to
glEnableClientState(GL_TEXTURE_COORD_ARRAY) after glTexCoordPointer(2, GL_FLOAT, 0, bananaTexCoords) to make it finally accept the texture
I do not know how generic this might be and if it's worth mentioning in generated header for example
thanks!
r.</description>
		<content:encoded><![CDATA[<p>Hello!<br />
thanks for the links, they&#8217;ve been helpful<br />
now, I couldn&#8217;t make the texturing of your banana to work, but it seems it required a call to<br />
glEnableClientState(GL_TEXTURE_COORD_ARRAY) after glTexCoordPointer(2, GL_FLOAT, 0, bananaTexCoords) to make it finally accept the texture<br />
I do not know how generic this might be and if it&#8217;s worth mentioning in generated header for example<br />
thanks!<br />
r.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Heiko Behrens</title>
		<link>http://www.heikobehrens.net/2009/08/27/obj2opengl/#comment-3910</link>
		<dc:creator>Heiko Behrens</dc:creator>
		<pubDate>Thu, 22 Oct 2009 08:07:12 +0000</pubDate>
		<guid isPermaLink="false">http://www.heikobehrens.net/?p=695#comment-3910</guid>
		<description>Hey R,
I am not completely sure what you are asking for. If your obj contains texture coordinates you can bin them using glTexCoordPointer as you can see in the generated comment of your .h file.

Loading the corresponding image file is another story, though. If you are not familiar with OpenGL ES and texture mapping these links might be helpful:
http://iphonedevelopment.blogspot.com/2009/05/opengl-es-from-ground-up-part-6_25.html
http://web.me.com/smaurice/AppleCoder/iPhone_OpenGL/Entries/2009/4/1_OpenGL_ES_05_-_Texture_Mapping_Our_Square.html</description>
		<content:encoded><![CDATA[<p>Hey R,<br />
I am not completely sure what you are asking for. If your obj contains texture coordinates you can bin them using glTexCoordPointer as you can see in the generated comment of your .h file.</p>
<p>Loading the corresponding image file is another story, though. If you are not familiar with OpenGL ES and texture mapping these links might be helpful:<br />
<a href="http://iphonedevelopment.blogspot.com/2009/05/opengl-es-from-ground-up-part-6_25.html" onclick="javascript:pageTracker._trackPageview('/outbound/comment/iphonedevelopment.blogspot.com');" rel="nofollow">http://iphonedevelopment.blogspot.com/2009/05/opengl-es-from-ground-up-part-6_25.html</a><br />
<a href="http://web.me.com/smaurice/AppleCoder/iPhone_OpenGL/Entries/2009/4/1_OpenGL_ES_05_-_Texture_Mapping_Our_Square.html" onclick="javascript:pageTracker._trackPageview('/outbound/comment/web.me.com');" rel="nofollow">http://web.me.com/smaurice/AppleCoder/iPhone_OpenGL/Entries/2009/4/1_OpenGL_ES_05_-_Texture_Mapping_Our_Square.html</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: fx61803</title>
		<link>http://www.heikobehrens.net/2009/08/27/obj2opengl/#comment-3908</link>
		<dc:creator>fx61803</dc:creator>
		<pubDate>Thu, 22 Oct 2009 02:46:49 +0000</pubDate>
		<guid isPermaLink="false">http://www.heikobehrens.net/?p=695#comment-3908</guid>
		<description>mr. behrens,
thanks for the converter, works like a charm!
after initial obstacles where it was not able to generate correct header file caused by not having only triangles in the model I am now able to compile the model with xcode; brilliant!

/ the converter produces a weird bug when skipping number values and leaving only commas in the array definition when the model is not in expected format, I guess; however when I exported the same model with triangles only, it works perfectly / 

however, since I am a complete noob in this field I even don't know if something like this makes sense, but is it possible to automatically apply a corresponding texture to a model defined like this in xcode? if so - how ? - does there exist a corresponding apple tutorial/concept which can be easily adopted for this ?
thank you very much!
r.</description>
		<content:encoded><![CDATA[<p>mr. behrens,<br />
thanks for the converter, works like a charm!<br />
after initial obstacles where it was not able to generate correct header file caused by not having only triangles in the model I am now able to compile the model with xcode; brilliant!</p>
<p>/ the converter produces a weird bug when skipping number values and leaving only commas in the array definition when the model is not in expected format, I guess; however when I exported the same model with triangles only, it works perfectly / </p>
<p>however, since I am a complete noob in this field I even don&#8217;t know if something like this makes sense, but is it possible to automatically apply a corresponding texture to a model defined like this in xcode? if so - how ? - does there exist a corresponding apple tutorial/concept which can be easily adopted for this ?<br />
thank you very much!<br />
r.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Heiko Behrens</title>
		<link>http://www.heikobehrens.net/2009/08/27/obj2opengl/#comment-3869</link>
		<dc:creator>Heiko Behrens</dc:creator>
		<pubDate>Mon, 19 Oct 2009 15:09:38 +0000</pubDate>
		<guid isPermaLink="false">http://www.heikobehrens.net/?p=695#comment-3869</guid>
		<description>Hey Alex, as stated in my comment http://www.heikobehrens.net/2009/08/27/obj2opengl/#comment-3460 above I used the GLGravity sample from Apple to produce the screenshot. Unfortunately, I cannot repost this code since it is protected by law. Feel free to ask any questions that arise following the steps I described on that comment, though.</description>
		<content:encoded><![CDATA[<p>Hey Alex, as stated in my comment <a href="http://www.heikobehrens.net/2009/08/27/obj2opengl/#comment-3460"  rel="nofollow">http://www.heikobehrens.net/2009/08/27/obj2opengl/#comment-3460</a> above I used the GLGravity sample from Apple to produce the screenshot. Unfortunately, I cannot repost this code since it is protected by law. Feel free to ask any questions that arise following the steps I described on that comment, though.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alex</title>
		<link>http://www.heikobehrens.net/2009/08/27/obj2opengl/#comment-3868</link>
		<dc:creator>Alex</dc:creator>
		<pubDate>Mon, 19 Oct 2009 14:27:34 +0000</pubDate>
		<guid isPermaLink="false">http://www.heikobehrens.net/?p=695#comment-3868</guid>
		<description>Please, include full xcode project
i try create test app - but it not work</description>
		<content:encoded><![CDATA[<p>Please, include full xcode project<br />
i try create test app - but it not work</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Heiko Behrens</title>
		<link>http://www.heikobehrens.net/2009/08/27/obj2opengl/#comment-3595</link>
		<dc:creator>Heiko Behrens</dc:creator>
		<pubDate>Thu, 01 Oct 2009 14:06:56 +0000</pubDate>
		<guid isPermaLink="false">http://www.heikobehrens.net/?p=695#comment-3595</guid>
		<description>Thank you for your suggestion, jason. I will implement this with the next iteration.</description>
		<content:encoded><![CDATA[<p>Thank you for your suggestion, jason. I will implement this with the next iteration.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jason colburne</title>
		<link>http://www.heikobehrens.net/2009/08/27/obj2opengl/#comment-3594</link>
		<dc:creator>jason colburne</dc:creator>
		<pubDate>Thu, 01 Oct 2009 14:04:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.heikobehrens.net/?p=695#comment-3594</guid>
		<description>this script should generate ansi c style comments (/* */) rather than c++ style to be more portable. just a suggestion =) trivial change</description>
		<content:encoded><![CDATA[<p>this script should generate ansi c style comments (/* */) rather than c++ style to be more portable. just a suggestion =) trivial change</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Heiko Behrens</title>
		<link>http://www.heikobehrens.net/2009/08/27/obj2opengl/#comment-3460</link>
		<dc:creator>Heiko Behrens</dc:creator>
		<pubDate>Thu, 24 Sep 2009 09:06:08 +0000</pubDate>
		<guid isPermaLink="false">http://www.heikobehrens.net/?p=695#comment-3460</guid>
		<description>Hey okfp,

as a starting point, use the GLGravity sample from the dev center and add the banana.h to the project. Now, replace the #import "teapot.h" in AppController.m with the banana.h and build the project. You will find to areas with errors, replace these lines with the ones given on top of the banana.h. First, replace the whole loop after "// Draw teapot" with the single glDrawArrays statement. Second, set the vertex and normal pointer as stated in the comments of banana.h. That's it.

I am sure you will find some sample code to learn the handling of textures, too.</description>
		<content:encoded><![CDATA[<p>Hey okfp,</p>
<p>as a starting point, use the GLGravity sample from the dev center and add the banana.h to the project. Now, replace the #import &#8220;teapot.h&#8221; in AppController.m with the banana.h and build the project. You will find to areas with errors, replace these lines with the ones given on top of the banana.h. First, replace the whole loop after &#8220;// Draw teapot&#8221; with the single glDrawArrays statement. Second, set the vertex and normal pointer as stated in the comments of banana.h. That&#8217;s it.</p>
<p>I am sure you will find some sample code to learn the handling of textures, too.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: okfp</title>
		<link>http://www.heikobehrens.net/2009/08/27/obj2opengl/#comment-3455</link>
		<dc:creator>okfp</dc:creator>
		<pubDate>Thu, 24 Sep 2009 00:07:26 +0000</pubDate>
		<guid isPermaLink="false">http://www.heikobehrens.net/?p=695#comment-3455</guid>
		<description>Heiko,

really amazing script. But I was trying to use to render your example in iphone simulator Xcode project. I don't know where I failed but I didn't see the bananas on the screen. I was trying to adjust glOrthof thinking should be big enough to see it, but doesn't work. Could you please provide your sample Xcode project or how do you implent that?

Thanks</description>
		<content:encoded><![CDATA[<p>Heiko,</p>
<p>really amazing script. But I was trying to use to render your example in iphone simulator Xcode project. I don&#8217;t know where I failed but I didn&#8217;t see the bananas on the screen. I was trying to adjust glOrthof thinking should be big enough to see it, but doesn&#8217;t work. Could you please provide your sample Xcode project or how do you implent that?</p>
<p>Thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Heiko Behrens</title>
		<link>http://www.heikobehrens.net/2009/08/27/obj2opengl/#comment-3284</link>
		<dc:creator>Heiko Behrens</dc:creator>
		<pubDate>Mon, 14 Sep 2009 09:16:24 +0000</pubDate>
		<guid isPermaLink="false">http://www.heikobehrens.net/?p=695#comment-3284</guid>
		<description>Hey Dawit,

thank you for your comment. Your exported obj file partly contains faces with 4 vertices each. Currently, this script has these known limitations, though: "This script expects and OBJ file consisting of vertices, texture coords and normals. Each face must contain exactly 3 vertices. The texture coords are two dimonsional."

Is it possible for you to export your model with triangles only?</description>
		<content:encoded><![CDATA[<p>Hey Dawit,</p>
<p>thank you for your comment. Your exported obj file partly contains faces with 4 vertices each. Currently, this script has these known limitations, though: &#8220;This script expects and OBJ file consisting of vertices, texture coords and normals. Each face must contain exactly 3 vertices. The texture coords are two dimonsional.&#8221;</p>
<p>Is it possible for you to export your model with triangles only?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dawit Thepchatree</title>
		<link>http://www.heikobehrens.net/2009/08/27/obj2opengl/#comment-3280</link>
		<dc:creator>Dawit Thepchatree</dc:creator>
		<pubDate>Mon, 14 Sep 2009 04:59:59 +0000</pubDate>
		<guid isPermaLink="false">http://www.heikobehrens.net/?p=695#comment-3280</guid>
		<description>Hey there Heiko,

I just came across this Perl script of yours (from dev forums), and it works great! I really like how you simplified things (very easy to use!) and made it cross-operational for many systems and platforms. :D

One gripe though: my Silo 2 exported OBJ file isn't showing up correctly for the iPhone OS. Some faces are gone. I think it has something to do with Silo 2's Triangulate function. Otherwise, when I deal with simpler models, it works fine. :)

Anyway, here's the OBJ file:
http://www.mediafire.com/?ykzyiwd2nde

Thanks.</description>
		<content:encoded><![CDATA[<p>Hey there Heiko,</p>
<p>I just came across this Perl script of yours (from dev forums), and it works great! I really like how you simplified things (very easy to use!) and made it cross-operational for many systems and platforms. <img src='http://www.heikobehrens.net/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
<p>One gripe though: my Silo 2 exported OBJ file isn&#8217;t showing up correctly for the iPhone OS. Some faces are gone. I think it has something to do with Silo 2&#8217;s Triangulate function. Otherwise, when I deal with simpler models, it works fine. <img src='http://www.heikobehrens.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Anyway, here&#8217;s the OBJ file:<br />
<a href="http://www.mediafire.com/?ykzyiwd2nde" onclick="javascript:pageTracker._trackPageview('/outbound/comment/www.mediafire.com');" rel="nofollow">http://www.mediafire.com/?ykzyiwd2nde</a></p>
<p>Thanks.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dan Bliss</title>
		<link>http://www.heikobehrens.net/2009/08/27/obj2opengl/#comment-3081</link>
		<dc:creator>Dan Bliss</dc:creator>
		<pubDate>Wed, 02 Sep 2009 15:34:44 +0000</pubDate>
		<guid isPermaLink="false">http://www.heikobehrens.net/?p=695#comment-3081</guid>
		<description>I found out the UV coords are not assigned automatically in Blender. In editmode press the U key and select "Sphere from View". The Perl script works great.</description>
		<content:encoded><![CDATA[<p>I found out the UV coords are not assigned automatically in Blender. In editmode press the U key and select &#8220;Sphere from View&#8221;. The Perl script works great.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Heiko Behrens</title>
		<link>http://www.heikobehrens.net/2009/08/27/obj2opengl/#comment-3074</link>
		<dc:creator>Heiko Behrens</dc:creator>
		<pubDate>Wed, 02 Sep 2009 04:46:53 +0000</pubDate>
		<guid isPermaLink="false">http://www.heikobehrens.net/?p=695#comment-3074</guid>
		<description>Hey Dan, could you please provide the OBJ file? I am going to look into this.</description>
		<content:encoded><![CDATA[<p>Hey Dan, could you please provide the OBJ file? I am going to look into this.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dan Bliss</title>
		<link>http://www.heikobehrens.net/2009/08/27/obj2opengl/#comment-3069</link>
		<dc:creator>Dan Bliss</dc:creator>
		<pubDate>Tue, 01 Sep 2009 22:30:50 +0000</pubDate>
		<guid isPermaLink="false">http://www.heikobehrens.net/?p=695#comment-3069</guid>
		<description>I created a simple planet with a single texture in Blender. I exported as a obj file with UV. When I run the script the .h file it map the texture over each triangle instead of mapping it over the object once. Any thoughts?</description>
		<content:encoded><![CDATA[<p>I created a simple planet with a single texture in Blender. I exported as a obj file with UV. When I run the script the .h file it map the texture over each triangle instead of mapping it over the object once. Any thoughts?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Heiko Behrens</title>
		<link>http://www.heikobehrens.net/2009/08/27/obj2opengl/#comment-3054</link>
		<dc:creator>Heiko Behrens</dc:creator>
		<pubDate>Tue, 01 Sep 2009 07:35:16 +0000</pubDate>
		<guid isPermaLink="false">http://www.heikobehrens.net/?p=695#comment-3054</guid>
		<description>Unfortunately, this script is generic and the OBJ file can be of any content. You might find this paper http://www.ics.uci.edu/~gopi/PAPERS/Sibgrapi06.pdf or this tool http://www.cs.sunysb.edu/~stripe/ helpful to understand the issue with strips in this case. Generally spoken: It is not possible to render arbitrary triangles as a single strip.

When splitting into several strips the generated script has to do the rendering part to configure the input this the right order. With an increasing amount of OpenGL roundtrips this might lead into performance issues as well.

Could you elaborate why memory size is a problem in your case?</description>
		<content:encoded><![CDATA[<p>Unfortunately, this script is generic and the OBJ file can be of any content. You might find this paper <a href="http://www.ics.uci.edu/~gopi/PAPERS/Sibgrapi06.pdf" onclick="javascript:pageTracker._trackPageview('/outbound/comment/www.ics.uci.edu');" rel="nofollow">http://www.ics.uci.edu/~gopi/PAPERS/Sibgrapi06.pdf</a> or this tool <a href="http://www.cs.sunysb.edu/~stripe/" onclick="javascript:pageTracker._trackPageview('/outbound/comment/www.cs.sunysb.edu');" rel="nofollow">http://www.cs.sunysb.edu/~stripe/</a> helpful to understand the issue with strips in this case. Generally spoken: It is not possible to render arbitrary triangles as a single strip.</p>
<p>When splitting into several strips the generated script has to do the rendering part to configure the input this the right order. With an increasing amount of OpenGL roundtrips this might lead into performance issues as well.</p>
<p>Could you elaborate why memory size is a problem in your case?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: magicboker</title>
		<link>http://www.heikobehrens.net/2009/08/27/obj2opengl/#comment-3046</link>
		<dc:creator>magicboker</dc:creator>
		<pubDate>Mon, 31 Aug 2009 17:17:39 +0000</pubDate>
		<guid isPermaLink="false">http://www.heikobehrens.net/?p=695#comment-3046</guid>
		<description>It seems better to use triangle_strip instead of triange for reducing memory size.
Could you please modify it?
Thanks!</description>
		<content:encoded><![CDATA[<p>It seems better to use triangle_strip instead of triange for reducing memory size.<br />
Could you please modify it?<br />
Thanks!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rendering 3D Models - iPhone Dev Forums</title>
		<link>http://www.heikobehrens.net/2009/08/27/obj2opengl/#comment-2970</link>
		<dc:creator>Rendering 3D Models - iPhone Dev Forums</dc:creator>
		<pubDate>Thu, 27 Aug 2009 19:47:10 +0000</pubDate>
		<guid isPermaLink="false">http://www.heikobehrens.net/?p=695#comment-2970</guid>
		<description>[...] rendering on the iPhone. Addressing your loading issue: There might be an alternative with obj2opengl. It's a script that converts wavefront obj files (nearly any 3d modeler can export this) to C/C++ [...]</description>
		<content:encoded><![CDATA[<p>[...] rendering on the iPhone. Addressing your loading issue: There might be an alternative with obj2opengl. It&#8217;s a script that converts wavefront obj files (nearly any 3d modeler can export this) to C/C++ [...]</p>
]]></content:encoded>
	</item>
</channel>
</rss>
