FlipNormals

This function reverses the triangle order and inverts the normals of the entire surface, effectively "lipping" the surface inside out.

Syntax

Returns

Returns the number of vertices in the surface.

Example

#include "App.h"

using namespace Leadwerks;

App::App() : window(NULL), context(NULL), world(NULL), camera(NULL) {}

App::~App() { delete world; delete window; }

Model* model = NULL;

bool App::Start()
{
window = Window::Create();
context = Context::Create(window);
world = World::Create();
camera = Camera::Create();
camera->SetRotation(35,0,0);
camera->Move(0,0,-3);
Light* light = DirectionalLight::Create();
light->SetRotation(35,35,0);

model = Model::Box();
model->SetColor(1.0,0.0,0.0);
Surface* surface = model->GetSurface(0);
surface->FlipNormals();

return true;
}

bool App::Loop()
{
if (window->Closed() || window->KeyDown(Key::Escape)) return false;

model->Turn(0,Leadwerks::Time::GetSpeed()*1.0,0);

Leadwerks::Time::Update();
world->Update();
world->Render();
context->Sync();

return true;
}