ofxOculusRift icon indicating copy to clipboard operation
ofxOculusRift copied to clipboard

ofDrawBackground + ofDrawBackgroundGradient don't work

Open obviousjim opened this issue 11 years ago • 6 comments

obviousjim avatar Oct 20 '13 17:10 obviousjim

Did you mean ofBackgroundGradient, maybe that's the problem. Hah! ;-)

OK, I setup an example project and when I use ofBackgroundGradient it works but, it's off to the top right. So what I did was just reposition it and now it's centered. Was this the issue? I might need to check out the actual project to get a better idea.

void ofApp::drawScene() { ofPushMatrix(); ofTranslate(-ofGetWidth()/2, -ofGetHeight()/2); ofBackgroundGradient(ofColor(50.0f, 50.0f, 50.0f), ofColor(0.0f,0.0f,0.0f)); ofPopMatrix(); }

ghost avatar Oct 22 '13 17:10 ghost

yeah this is what I mean, typing from memory sorry =)

If this works, that's dead easy. Does the same translation work for both left and right eye?

Next we should look into how to draw 2D content as that's definitely a bit trickier =)

obviousjim avatar Oct 23 '13 18:10 obviousjim

Yeah it looks great for both eyes. I've been drawing some 2D stuff, it works -- just floats in space. But, I can do some more of that with the Leap/Oculus demo I'm working on. :-)

On Wed, Oct 23, 2013 at 2:44 PM, James George [email protected]:

yeah this is what I mean, typing from memory sorry =)

If this works, that's dead easy. Does the same translation work for both left and right eye?

Next we should look into how to draw 2D content as that's definitely a bit trickier =)

— Reply to this email directly or view it on GitHubhttps://github.com/obviousjim/ofxOculusRift/issues/3#issuecomment-26933522 .

ghost avatar Oct 23 '13 18:10 ghost

Are you referring to the 2d warping or rotation issues? I think the only way to solve this is to lock it in place. Might have to apply some inverted translation/rotations on it or maybe there's an easier way.

On Wed, Oct 23, 2013 at 2:53 PM, Jason Walters [email protected] wrote:

Yeah it looks great for both eyes. I've been drawing some 2D stuff, it works -- just floats in space. But, I can do some more of that with the Leap/Oculus demo I'm working on. :-)

On Wed, Oct 23, 2013 at 2:44 PM, James George [email protected]:

yeah this is what I mean, typing from memory sorry =)

If this works, that's dead easy. Does the same translation work for both left and right eye?

Next we should look into how to draw 2D content as that's definitely a bit trickier =)

— Reply to this email directly or view it on GitHubhttps://github.com/obviousjim/ofxOculusRift/issues/3#issuecomment-26933522 .

ghost avatar Oct 24 '13 00:10 ghost

Not sure I follow but sounds like you are thinking the right way =)

obviousjim avatar Oct 24 '13 02:10 obviousjim

If this is about placing 3d objects independent of head rotation,

    ofMultMatrix(oculusRift.getOrientationMat());

should work.

micuat avatar Mar 03 '16 23:03 micuat