{"author_name":"magneus","cat":"MiniLD","comments":[{"author_name":"JohnColburn","time":"August 1, 2011 6:04 pm","epoch":1312239840,"text":"This is just a guess, but is it possible that the texture is being flipped?","spam":"N"}],"epoch":1312216620,"likes":2,"metadata":{"p_key":"65392","p_author":"magneus","p_authorkey":"2624","p_urlkey":"101188","p_title":"Moonbase Shootout: Texture Mapping Issues","p_cat":"MiniLD","p_event":"LD21","p_time":"1312216620","p_likes":"2","p_comments":"1","p_status":"UPD5","us_key":"2624","us_name":"magneus","us_username":"magneus","event_start":"1313712000","event_key":"7","event_name":"LD21"},"text":"<div class='posterous_autopost'>So in Moonbase Shootout, my entrant for Mini LD #28, I ran into some texture mapping issues.\n <p \/>I&#039;m on <a href=\"http:\/\/code.google.com\/p\/libgdx\/\">LibGDX<\/a> (which was great to work with!), and here&#039;s what my model should look like, textured:\n <p \/>\n <div class='p_embed p_image_embed'> <a href=\"http:\/\/posterous.com\/getfile\/files.posterous.com\/dkcodeblog\/YLUmH68IAcaIrJaHEUhL7WY1vwVi61bLqPDDgS8drWfpGWCNV9mysIKMXWDA\/ufo-should.png\"><img alt=\"Ufo-should\" height=\"309\" src=\"http:\/\/posterous.com\/getfile\/files.posterous.com\/dkcodeblog\/8bN8St4eSwghREegXjLpQjb7jksGgTuBZeNyFCeTCPamQbnvJkzPjQSdRtoE\/ufo-should.png.scaled.500.jpg\" width=\"500\" \/><\/a> <\/div>\n <p \/>Unfortunately, in-game, the textures didn&#039;t map correctly to the mesh.\n <p \/>As you see here, the stripe that should circle the UFO is actually on the bottom, and the purple dome doesn&#039;t sit flush.\n <p \/>\n <div class='p_embed p_image_embed'> <img alt=\"Ufo-observed\" height=\"127\" src=\"http:\/\/posterous.com\/getfile\/files.posterous.com\/dkcodeblog\/EYMt25CgefDMhwOz0aeA511gFUJoH11JB77992EJFPlu88xXlYmbtOgLiAGb\/ufo-observed.png\" width=\"155\" \/> <\/div>\n <p \/>Here&#039;s my texture:\n <p \/>\n <div class='p_embed p_image_embed'> <img alt=\"Ufo-texture\" height=\"256\" src=\"http:\/\/posterous.com\/getfile\/files.posterous.com\/dkcodeblog\/hBu0WOTEWBECOBkNWdrUc1PSAyS4XjMByAaBRPNu7f0Kq5x24yH7k7supkha\/ufo-texture.png\" width=\"256\" \/> <\/div>\n <p \/>And here&#039;s the offending code to load the mesh and the texture:\n <p \/> \u00a0\u00a0\u00a0\u00a0\u00a0 InputStream in = Gdx.files.internal(&quot;data\/ufo.obj&quot;).read();<br \/>\u00a0\u00a0\u00a0\u00a0\u00a0 Mesh alienMesh = ModelLoaderOld.loadObj(in);<br \/>\u00a0\u00a0\u00a0\u00a0\u00a0 in.close();\n <p \/>\u00a0\u00a0\u00a0\u00a0\u00a0 Texture alienTexture = new Texture(Gdx.files.internal(&quot;data\/ufo.png&quot;), Format.RGB565, true);<br \/> \u00a0\u00a0\u00a0\u00a0\u00a0 alienTexture.setFilter(TextureFilter.MipMap, TextureFilter.Linear);\n <p \/>Anyone seen this before?<\/div>","time":"August 1st, 2011 11:37 am","title":"Moonbase Shootout: Texture Mapping Issues"}