Sign in to follow this  

rubber band in 3d world window

This topic is 4857 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I posted about this in Graphics forum, but I didn't get the answer, so I'm posting again here.. I was wondering if openGL rubber banding (using logical operator XOR) could be implemented on the 3d world window. At first, I was trying to use gluUnproject to the near plane using the window coordinate I get from mouse dragging, but I found I don't get the right coordinates after I rotate the world. The box wasn't a box anymore :( I guess because projection matrix does not get changed?? Is there anyway I can do this??? The 3d world is defined as frustum (I use gluPerspective). Thank you!! -SJ

Share this post


Link to post
Share on other sites
But, if you feel like it's absolutely necessary, check out SDL. You can use SDL's 2D support along with OpenGL3D so you could render your OpenGL to a surface and then update only the portion of the surface you need. This could be helpful for in game menus where you don't need to render OpenGL anymore, just make sure the surface is displayed behind the menu. I had to wait for Luke Miklos to jog my memory of what "rubberbanding" was before I could reply. If you have the book "Black Art of 3D Game Programming", there's a lot of stuff on "rubberbanding" in there due to being written a long time ago.

Share this post


Link to post
Share on other sites
Quote:
Original post by greentea8202
I was wondering if openGL rubber banding (using logical operator XOR) could be implemented on the 3d world window.
At first, I was trying to use gluUnproject to the near plane using the window coordinate I get from mouse dragging, but I found I don't get the right coordinates after I rotate the world. The box wasn't a box anymore :( I guess because projection matrix does not get changed??

gluUnProject should work - the most common problem people have with it, is that they don't realize that the viewing transformation of the scene has to be in the modelview matrix that is sent to gluUnProject for it to work.

Unless I've misunderstood what it is you're trying to do, I don't see any reason why you shouldn't use this technique with OpenGL [smile]

Share this post


Link to post
Share on other sites
the reason you shouldn't worry about rubberbanding is because as the rubberbanded object moves, it erases whatever was behind it. Now if you just have 1 object in the window... perhaps a shape of some sort... & thats it... then no problem, use rubberbanding all you want for your lil shape. This of course can be remedied with a seperate buffer that paint on the scene, but then that defeats the purpose... because you are repainting that buffer every time anyways. apparently color shoulnd't matter either, because if you XOR colors onto a scene, they will look very weird & you will probably get undesired results. the point is... what in the world kind of application are you running & on what type of machine that its so necessary to NOT clear the openGL buffers & redraw the scene every frame?


Share this post


Link to post
Share on other sites

This topic is 4857 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this