Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
PhilAndrew opened this issue Feb 23, 2014 · 3 comments
Open

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

PhilAndrew opened this issue Feb 23, 2014 · 3 comments

Comments

@PhilAndrew
Copy link

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
Copy link
Author

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

@PhilAndrew
Copy link
Author

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
Copy link

jonboj commented May 3, 2014

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants