Draw non transparent devices
Submitted by leon_noah on March 19, 2008 - 3:59pm.
Hi all ,
I have simple application which read VRML file , and draw it using OpenGL (In Tao Framework).
My program contained init function , Perspective init function , light init function and finely the Render function which draw triangles ( parsed from the VRML file).
My VRML model described same device ( like door handle) and same screws within the device. those screws are hidden .
My problem is that the opengl draw my handle transparently and the screws which located inside the device are displayed.
I try all most everything include enabling the depth_test.
I guess I miss same stupid declaration.
Best regards , Leon.

Can you post a screenshot of
Can you post a screenshot of the issue?
Also, please remove your email from public display - unless you enjoy spam that is
------
OpenTK
a screenshot to my
a screenshot to my drawing:
http://img386.imageshack.us/img386/1351/deviceji4.jpg
In the following link you can see my device. the small balls are located within the device.
I read my device using VRML viewer and it display the following :
http://img386.imageshack.us/img386/3663/device2pm3.jpg
you can see clearly that the balls are hidden.
Thanks ,Leon
I can't quite see it from
I can't quite see it from the image, but did you check it isn't drawing inside-out because of back face culling?
Thank you all for yours
Thank you all for yours reply
I finally understand what goes wrong with my code.
The gluPerspective get bad Znear and Zfar values. The Z values was too big , there for the OpenGl handled the Zbuffer badly.
Calculation the minimum and maximum z values and used then in the gluPerspective solve the problem.
The gluPerspective(angleOfView, 1.0, minZ, MaxZ );
Thanks again .
Leon.
Good info!!
Good info!!