"openFrameworks Essentials" book has been published


#1

Our book openFrameworks Essentials by Denis Perevalov, Igor (Sodazot) Tatarnikov has been published by Packt Publishing.

The book is devoted to learning basics of openFrameworks by creating video synthesizer project along the book.

The book’s source codes are available for free downloading at the book’s page https://www.packtpub.com/application-development/openframeworks-essentials (“Code Files” button).

The sample chapter with the scheme of created video synthesizer is here: http://www.slideshare.net/Products123/openframeworks-essentials-sample-chapter


#2

Super awesome!


#3

Great book for beginners!

Question about chapter 5:
In step 3 of “Drawing a solid sphere with shading” nothing but the gui appears when adding the following lines:

ofDisableDepthTest();
material.end();
light.disable();
ofDisableLighting();

I tired commenting out combinations to see where the issue is, but don’t see where the issue is. I am using OF 0.8.4

Maybe I missed something but I don’t see it:

void ofApp::Draw3D()
{
	light.setPosition(ofGetWidth()/2, ofGetHeight()/2, 600);
    light.enable();
    material.begin();
    ofEnableDepthTest();
    
    cam.begin();
    ofSetColor( ofColor::white );
    sphere.draw();
    cam.end();
    
    ofDisableDepthTest();
    material.end();
    light.disable();
    ofDisableLighting();
}

The code from the download seems to work, but there are a few differences in the downloaded code and where I am currently in the chapter. I will continue on with the chapter to see if it clears up, but it doesn’t seem to work as it should in the order that it is presented now (again unless I missed a step).

Thanks!
Brad


#4

Thanks!

Oh, the code looks correct. - Please, could you send me your whole sources - ofApp.h and ofApp.cpp? - in this topic or to perevalovds@gmail.com

Which OS are you using?

regards,
Denis


#5

Hi I’m new on OF. I bought the book but I have a problem with chapter 6. When I launch the code I have this problem.


Someone can help me? thanks

Have a good day
Diego


#6

the code doesnt compile from chapter 5 onwards, which is a shame =(

one error is with the line:
vertices0 = sphere.getMesh().getVertices();

and the error which is given is: no viable overloaded ‘=’

any help would be apreciated
thanks, jack


#7

Hi,
I have not read that book but it already has some years and openFrameworks has changed a bit.
In the case of your problem I am almost sure it is because OF has now switched to use GLM vector maths instead of using its own vector classes.
So, probably your vertices0 variable is of the type vector<ofVec3f>, which is what the getVertices() function used to return. Now, as I said, openFrameworks switched to GLM, thus this function returns a vector<glm::vec3>. So simply said, where ever you have declared your vertices0 object, which should read like vector<ofVec3f> vertices0; just change it for vector<glm::vec3> vertices0; .
Furthermore, in a lot of cases ofVec3f can automatically get converted back and forth to glm, but not when it is used in a container such as a vector. This said, the easiest thing to do is, when ever you come across to a vector<ofVec3f> object just change it to be vector<glm::vec3>.
Be aware though that the glm::vec3 is not compatible with the ofVec3f class regarding its methods, it will only work when you access its variables (x, y or z).

Last but not least, if you are not happy with changing to glm or having to fix the code to make it work, then go to the ofConstants.h file and change the line that reads #define OF_USE_LEGACY_VECTOR_MATH 0 to #define OF_USE_LEGACY_VECTOR_MATH 1

hope this helps.
cheers