In the latest version of ofx3DUtils, in the example, the setup function sets centerX and centerY to half the screen height and width, and also calls setOrigin(OF_ORIGIN_ZERO):
centerX = ofGetWidth()/2;
centerY = ofGetHeight()/2;
As written and compiled, the four 3d objects move off to the right of the screen so that only the squashed sphere is visible.
Removing the setOrigin(OF_ORIGIN_ZERO) call suffices to fix the example. Alternatively, setting centerX and centerY to 0 brings the objects back into their proper positions, but if you do that you’ll have to change the coordinates for Light 3 (the one that follows the mouse).
Thanks for the camera tools!
PS Sorry if this belongs in the extend forum…
yes that’s a bug, don’t know how that slipped in.
OF_ORIGIN is used when you want to use the OF origin coordinates, i.e. (0,0) is the top left hand side of the screen. This is used by default.
OF_ORIGIN_ZERO sets (0,0) to be the centre of the screen, i.e. the classic OPENGL origin.
You set the origin via setOrigin(OF_ORIGIN_ZERO) or setOrigin(OF_ORIGIN).
I’ve updated the project and uploaded it here:
By the way OF version 0.07 should include a basic camera by default, so this Addon will become redundant.
Thanks for the reply and information. Glad to hear the camera will be incorporated into the oF core!
Another quick problem I found… the install.xml references ofx3DCamera.h and ofx3DCamera.cpp, which don’t exist. This didn’t affect compiling on the Mac in XCode, but did affect it using Code::Blocks on Ubuntu.
Yes I’ve fixed this too in the latest version i put up…