Advertisement

[ The axes of the coordinate system seems to interfere with the backrground of the scene]

Started by May 17, 2022 09:57 AM
3 comments, last by Thaumaturge 2 years, 7 months ago

Hello guys, I hope you're doing well.

So I created a scene on Qt6 using OpenGL in which I added a cube and its coordinate system.

When I rotate the cube, the axes of the coordinate system seem to interfere with the black background of the scene.

Here is an orientation of the cube where the red axis is totally visible:

Now when I keep rotating the object, I get this:

It seems like a part of the Red axis has disappeared or was hidden by the black background of the scene.

Although I enabled the depth test, I still get the same problem.

Please help me.

Any help would be appreciated.

Thank you All.

Could it be that your arrows are extending far enough that they're being clipped by the camera's far-plane?

In case you're not familiar with this, a brief explanation--in general, and simplifying somewhat:

An OpenGL camera renders geometry within a space directly in front of it: geometry that is further away than a certain distance, and closer than a second distance. That first distance (along with the camera's direction) defines a plane which is termed the “near-plane”, while that second distance (again, with the camera's direction) defines a plane which is termed the “far-plane”.

And anything that falls outside of that space--anything closer than the “near-plane” or further than the “far-plane"--is clipped away--an effect that looks much like the screenshot that you posted above.

So the questions here would be: First, what are the values that you have for your near- and far- planes, and second, how big is the object that you're rendering?

MWAHAHAHAHAHAHA!!!

My Twitter Account: @EbornIan

Advertisement

@thaumaturge yes yes, I changed the value of the zfar ( I increased it) and it worked.

zFar was equal to 7.0 but I increased its value to 9.0

const qreal zNear = 3.0, zFar = 9.0, fov = 45.0;

Also my object isn't that big, I used matrix.scale function to minimize its size

localMatrix.scale(0.4,0.4,0.4);

Thank you so mcuh for the easy and clear explanation.

It's my pleasure--I'm glad to have helped, and that you have a solution to your problem. ^_^

MWAHAHAHAHAHAHA!!!

My Twitter Account: @EbornIan

This topic is closed to new replies.

Advertisement