groverburger / g3d

Simple and easy 3D engine for LÖVE.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Normal not getting setted

CoderLFS opened this issue · comments

Hi,

I'm creating a model which is basically a plane like this:
local tile = g3d.newModel({ {-3, 0, 2, 0, 0}, { 2, 0, 2, 1, 0}, { 2, 0,-1.5, 1, 1}, {-3, 0, 2, 0, 0}, { 2, 0,-1.5, 1, 1}, {-3, 0,-1.5, 0, 1}, })

I want it to be visible only from one side so i decided to try:
tile:makeNormals()
before drawing the mesh.

Problem is that the mesh still draws white on both side.

Is the problem coming from a misuse or a bug?

Thank you

Normals have nothing to do with front face culling, that's a function within love.graphics use love.graphics.setMeshCullMode and love.graphics.setFrontFaceWinding to cull your meshes faces

Problem solved, thank you