Jump to content


Transparent Faces


4 replies to this topic

#1 TheLionKing

    Valued Member

  • Members
  • PipPipPip
  • 143 posts

Posted 25 September 2003 - 12:54 AM

Hi,

I have simple drawn a 3d Triangle or a pyramid with four faces. There order is

1 - Front Face
2 - Left Face
3- Back Face
4- Right Face

Pyramid is drawn right ... my problem is I can see through it. After ananlyzing it I came to the following observations :
  • Through 1 I can see 2, 3 & 4.
  • Through 2, I can see 3 & 4.
  • Through 3 I can see only 4.
  • And nothing can be seen through 4.
How come I am seeing through surfaces.
There is something I am missing, right?

Please help!
<span style='color:blue'>I can survive anything ... even NUKES!!!
The Lion King</span>

#2 anubis

    Senior Member

  • Members
  • PipPipPipPip
  • 2225 posts

Posted 25 September 2003 - 02:59 AM

hmm, depth-buffer enabled ?
setup the projection matrix in the right way ?
backface culling enabled ?
If Prolog is the answer, what is the question ?

#3 TheLionKing

    Valued Member

  • Members
  • PipPipPip
  • 143 posts

Posted 25 September 2003 - 03:12 AM

Depth Buffer is enabled, lighting is off and Back Face Culling is off. Here is the code :
Graphics->SetRenderState (D3DRS_LIGHTING, false);    // Set Lights Off
 Graphics->SetRenderState (D3DRS_CULLMODE, D3DCULL_NONE); // Do not cull Back Faces
 Graphics->SetRenderState (D3DRS_ZENABLE, D3DZB_TRUE);  // Enable Depth Buffering

And for the Projection Matrix :

 float AspectRatio = (float)Width / (float)Height; // Ratio between Width & Height

// Initialize Perspective View for the Screen
 D3DXMatrixPerspectiveFovLH (&Projection, // Projection Matrix
               1.0f,    // Field of View
               AspectRatio, // Aspect Ratio of the Screen
               0.0f,    // Nearest Clipping Plane
               100.0f);   // Farthest Clipping Plane
 
 // Setup Projection Matrix for the Screen
 Graphics->SetTransform (D3DTS_PROJECTION, &Projection);

Is there anything to do with nearest clipping plane or the Field Of View? :sigh:
<span style='color:blue'>I can survive anything ... even NUKES!!!
The Lion King</span>

#4 TheLionKing

    Valued Member

  • Members
  • PipPipPip
  • 143 posts

Posted 25 September 2003 - 03:49 PM

It was nearest clipping plane ... thanks :lol: !
<span style='color:blue'>I can survive anything ... even NUKES!!!
The Lion King</span>

#5 anubis

    Senior Member

  • Members
  • PipPipPipPip
  • 2225 posts

Posted 25 September 2003 - 03:52 PM

i was going to tell you just that...
If Prolog is the answer, what is the question ?





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users