I’ve written a class that generates a mesh, and I would like to inherit from of3dPrimitive
but I’ve got an error: “drawNormals(): mesh normals are disabled”
I’ve done the following:
#pragma once
#include "ofMain.h"
#include "of3dPrimitives.h"
class ofxMyClass : public of3dPrimitive {
public:
void setup(); //
void build();
void draw();
// ...
private:
// ...
void setMeshMode(string geometry);
ofVboMesh mesh;
mutable ofMesh normalsMesh;
//validations
bool thetaValueIsinRange(float theta);
bool isAxiomInRules(string _axiom, vector<string> _strRules);
void validateInput(string _axiom, vector<string> _strRules, float theta);
}
I was expecting to be able to call drawNormals
and to see the normal, but I’ve received this warning "“drawNormals(): mesh normals are disabled”.
I’ve called mesh.enableNormals
in my setup method, as I’ve read here https://github.com/openframeworks/openFrameworks/blob/master/libs/openFrameworks/3d/of3dPrimitives.cpp but without any success.
I think that I’m missing something in the correct setup of this class in order to be able to inherit from of3dPrimitive
, it is also not clear to me how I would be able to call method like move
if I haven’t declared an ofNode in this class.
Any suggestion is more than appreciated!