trying to draw cylinder
-
Alucard344
- Posts: 21
- Joined: Wed May 20, 2009 8:17 pm
- Location: Qc, Canada
trying to draw cylinder
Hi,
I am having a strange problem.
What i am trying to do is to draw a lot of cylinder. Those cylinder have a small radius (they represent drill hole).
All my cylinder are batched into a mesh.
The problem is, when I zoom out or zoom in, the cylinders start flicking. Some disseapear while some other reappear. The cylinder that appear or disseaper are completely random. Its like if the triangle were too small for the engine to detect if they should be drawn or not.
If i draw them in wireframe, then no more problem. everything is drawn perfectly and i can zoom in or out and everything is fine.
When i am really near the cylinder, they are all fine.
if i draw my cylinder with a bigger radius, i have to zoom out more for the flicking to begin. but it still happen at some point.
Also, i am using an orthogonal camera.
Does anyone have an idea of what i could do to fix this problem ?
And sorry for my english, it is not my primary language.
Thanks
I am having a strange problem.
What i am trying to do is to draw a lot of cylinder. Those cylinder have a small radius (they represent drill hole).
All my cylinder are batched into a mesh.
The problem is, when I zoom out or zoom in, the cylinders start flicking. Some disseapear while some other reappear. The cylinder that appear or disseaper are completely random. Its like if the triangle were too small for the engine to detect if they should be drawn or not.
If i draw them in wireframe, then no more problem. everything is drawn perfectly and i can zoom in or out and everything is fine.
When i am really near the cylinder, they are all fine.
if i draw my cylinder with a bigger radius, i have to zoom out more for the flicking to begin. but it still happen at some point.
Also, i am using an orthogonal camera.
Does anyone have an idea of what i could do to fix this problem ?
And sorry for my english, it is not my primary language.
Thanks
-
Alucard344
- Posts: 21
- Joined: Wed May 20, 2009 8:17 pm
- Location: Qc, Canada
Thanks for your fast answer,
I have made some test, generating only one triangle per cylinder but the problem remain.
the problem seems to happen only in orthogonal view.
here is screenshot of what i see. only 1 triangle per cylinder to be as simple as possible.
this is what it is supposed to look like. this is in wireframe. each line are in fact a triangle that you could see when zooming in.

Now this is an orthogonal view shaded mode. a lot of them as disseapeared and are flicking randomly when zooming in or out

And finally this is an oblique view, shaded again. all cylinder are there but they look like dotted line

are the triangle too small to be displayed correctly ? what could be the problem ?
Thanks
I have made some test, generating only one triangle per cylinder but the problem remain.
the problem seems to happen only in orthogonal view.
here is screenshot of what i see. only 1 triangle per cylinder to be as simple as possible.
this is what it is supposed to look like. this is in wireframe. each line are in fact a triangle that you could see when zooming in.

Now this is an orthogonal view shaded mode. a lot of them as disseapeared and are flicking randomly when zooming in or out

And finally this is an oblique view, shaded again. all cylinder are there but they look like dotted line

are the triangle too small to be displayed correctly ? what could be the problem ?
Thanks
-
Alucard344
- Posts: 21
- Joined: Wed May 20, 2009 8:17 pm
- Location: Qc, Canada
and what can i do if it is frontface backface culling fighting ?
i have tried this but it doesnt change anything
i have tried this but it doesnt change anything
Code: Select all
material.BackfaceCulling = false;
material.FrontfaceCulling = false;
-
Alucard344
- Posts: 21
- Joined: Wed May 20, 2009 8:17 pm
- Location: Qc, Canada
Code: Select all
static const long CAMERA_FAR_VALUE = 1000000;
static const long CAMERA_NEAR_VALUE = 1;
irr::core::matrix4 matrix;
matrix.buildProjectionMatrixOrthoLH(width, height,CAMERA_NEAR_VALUE, CAMERA_FAR_VALUE);
m_smgr->getActiveCamera()->setProjectionMatrix(matrix,true);
-
Alucard344
- Posts: 21
- Joined: Wed May 20, 2009 8:17 pm
- Location: Qc, Canada