I have an orthographic camera that looks like this:


I create 2d polygonal meshes that have uniform z values in their vertices. I use Camera.ViewportToWorldPoint() to map these viewpoint vertices to world vertices.

The initial z valueI use for each polygon vertex is 1.0f. When I view my generated polygons, they each have a scale of (1,1,1) and are not being rendered. However, when I set the z value of the scale to any value less than zero, the mesh is rendered.

Could this be an issue with my camera's properties?

| improve this question | | | | |
  • 2
    \$\begingroup\$ Sounds to me like vertex winding order prpblem \$\endgroup\$ – user39686 Jan 7 '15 at 18:51

Apparently Unity only render one face of the quad with the default shader (you can test it by moving your camera around). By setting another shader (in your case "Sprite/Default" should do the stuff), it will render both faces.

At least it solved the problem for me.

The reason it work with negative z is that a negative scale will flip the quad (thus exposing the other face to your camera).

| improve this answer | | | | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.