0
\$\begingroup\$

I have an orthographic camera that looks like this:

Camera

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?

\$\endgroup\$
  • 2
    \$\begingroup\$ Sounds to me like vertex winding order prpblem \$\endgroup\$ – Thebluefish Jan 7 '15 at 18:51
1
\$\begingroup\$

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).

\$\endgroup\$

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.