Jump to content

  • Log In with Google      Sign In   
  • Create Account


Displaying part of an Object existing outside the Viewport...


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
3 replies to this topic

#1 intenseza   Members   -  Reputation: 119

Like
0Likes
Like

Posted 06 March 2013 - 03:33 PM

I'm implementing the cohen clipping algorithm and in order to do this, I need to be able to show the parts of the line that are outside the viewport in a different colour. How is it possible to show objects that aren't within the viewport?

 

Cheers



Sponsor:

#2 C0lumbo   Crossbones+   -  Reputation: 2202

Like
0Likes
Like

Posted 07 March 2013 - 11:01 AM

Presumably this is some sort of homework assignment style task, because otherwise I don't understand the question since you don't normally need to clip lines yourself, and rendering stuff outside your viewport is generally not desired or possible.

 

So I believe that what you need to do is setup OpenGL as you normally would do, then create your own sub-viewport within that (e.g. half the width, half the height and centre it) which you can do your software clipping to. That way you can colour the lines inside the sub-viewport one colour, and outside the sub-viewport another colour and still be able to see them.



#3 Lee A. Stripp   Members   -  Reputation: 373

Like
0Likes
Like

Posted 07 March 2013 - 12:34 PM

Just setup 2 camera's, do your culling based on one cameras frustum (or your method) and use the second camera as the viewing camera. that way you can move the second camera around and see the results better. Does this make sense?


Cheers

Lee

 

Code is Life
C/C++, ObjC Programmer, 3D Artist, Media Production

 

Website : www.leestripp.com
Skype : lee.stripp@bigpond.com
Gmail : leestripp@gmail.com


#4 Nercury   Crossbones+   -  Reputation: 766

Like
0Likes
Like

Posted 08 March 2013 - 05:18 PM

So I believe that what you need to do is setup OpenGL as you normally would do, then create your own sub-viewport within that (e.g. half the width, half the height and centre it) which you can do your software clipping to. That way you can colour the lines inside the sub-viewport one colour, and outside the sub-viewport another colour and still be able to see them.

 

You can also clip the viewport with glScissor, I think it will make it easier because with smaller viewport the FOV would need to be adjusted to match larger viewport.


Edited by Nercury, 08 March 2013 - 05:29 PM.





Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS