threeDart / three.dart

Dart port of three.js
http://threedart.github.com/three.dart/
MIT License
388 stars 99 forks source link

Why is the texture in the example flipped upside down? #124

Open PhilAndrew opened 10 years ago

PhilAndrew commented 10 years ago

Hi, why is the texture in this example flipped upside down? web_gl_geometry_cube http://threedart.github.io/three.dart/example/web_gl_geometry_cube/web_gl_geometry_cube.html

https://github.com/threeDart/three.dart/blob/master/example/web_gl_geometry_cube/web_gl_geometry_cube.dart

If you comment out the rotation in the animate function, you can see the texture is exactly flipped upside down. //cube.rotation.x += 0.005; //cube.rotation.y += 0.01;

Is this a bug? if not, can you please explain why it is the case and how to fix?

PhilAndrew commented 10 years ago

I mean, the example at ThreeJS is correct, the cube texture is correct. http://threejs.org/examples/webgl_geometry_cube.html

PhilAndrew commented 10 years ago

I think its a bug:

In any case, this seems to be an old bug in CubeGeometry in three.js, which was fixed in July 2012 but has not been fixed in three.dart.

http://stackoverflow.com/questions/21968644/why-is-the-texture-image-upside-down-in-this-example-dart-threejs

jonboj commented 10 years ago

Hi, I experience the same. In the Texture class it seems that .flipY by default is true. In three.js this is false. In my case it took some time and bug hunting, before I realized this. The workaround is a simple one liner. Texture texture = ImageUtils.loadTexture(wmsGetMapUrl, mapping: new UVMapping()); texture.flipY = false;//Disable the default vertical flip.