Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

OpenGL question: How to create a "probe" effect?

Status
Not open for further replies.

fabien

Technical User
Sep 25, 2001
299
AU
Hello,

First of all I am not sure whether it's the best place to ask this question but I did not find an OpenGL forum...

I am trying to do the following:
I am displaying a cube with a mesh drawn onto it and I would like to create a new smaller cube which I could move inside the big one. This small cube should be transparent so that I can see through it thus inside the bigger cube.
This would act like a "probe" to see inside a cube.

Does anyone known how to do this?

Thanks,

Fabien
 
If you want to see inside the big cube, why don't you simply put your camera into it?
 
Thanks for your reply Kenrae,

I am not sure how this would help. I don't only want to see inside it but also draw the intersection planes between the small and big cubes.

I want to be able to move/resize the small cube interactively but I am not sure how to do this.
 
Then, you shouldn't put your cube as a cube object into OpenGL. I'd have an external cube object, managed by me, and I'd put only lines (the edges) into OpenGL.
If you want to draw changes on it interactively, then you should draw it differently from the rest of the objects. Something like:

1- Draw 3D objects (an OpenGL "database").
2- Draw camera-cube (another OpenGL "database" using XOR)

When user changes camea-cube parameters, then:

1- Draw former camera-cube (restoring previous image using XOR).
2- Draw new camera-cube.

This way you won't have an intermitent effect.

If this seems difficult, you can visit
 
Thanks for this. I am fairly new to OpenGL I don't know what XOR is. I have tried the link you mentioned but it does not work. WOuld you have any other links?
 
That's strange, it works for me.
I don't have more links here, but you'll find a lot searching at
XOR is a method to paint pixels. When you paint with this method, you can erase what you have just painted only by painting the object again. That way you avoid flickering.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top