Results 1 to 11 of 11

Thread: Direct 3D

  1. #1

    Thread Starter
    Fanatic Member petrus's Avatar
    Join Date
    May 2002
    Location
    pBytes[sizeof(pBytes)/2]
    Posts
    553

    Direct 3D

    Hello,
    I have a room in 3D, in the middle of the room I have two walls, with some space between.
    The walls have a fence texture on them and is transparent on some places.
    I can see thru one of the walls and on to the other one, but if I look thru the other wall I don't see the first wall.
    What's my problem? How to solve it?
    ICQ: 128716725

  2. #2
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    You need to have *two* polygons for the wall, pointing in opposite directions. The system doesn't display any polygons pointing away from you, as it assumes a solid object will cover those up with real forward-facing polygons.

    You *can* disable this, but I would recommend the first course.
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

  3. #3

    Thread Starter
    Fanatic Member petrus's Avatar
    Join Date
    May 2002
    Location
    pBytes[sizeof(pBytes)/2]
    Posts
    553
    I know, but all walls is blocks with 6 faces, each face have 2 triangles, forming a rect.
    The walls isn't build with only 2 triangles, else the culling would have removed them, the culling isn't the problem here.
    Should I have 4 triangles instead of 2 on each face, pointing the same direction but draw the first 2 triangles in the correct order, when I've drawn them I draw the other ones, but in the opposite order?
    Last edited by petrus; Nov 29th, 2002 at 03:13 PM.
    ICQ: 128716725

  4. #4
    Frenzied Member Zaei's Avatar
    Join Date
    Jul 2002
    Location
    My own little world...
    Posts
    1,710
    Its actually a problem with Alpha blending. Any transparent objects that are drawn in front of, and before another transparent object will cause the second object to not be drawn, because its pixels have already been written over in the zbuffer. You have to depth sort your transparent objects, and draw them all last.

    Z.

  5. #5

    Thread Starter
    Fanatic Member petrus's Avatar
    Join Date
    May 2002
    Location
    pBytes[sizeof(pBytes)/2]
    Posts
    553
    Should I do that manual?
    ICQ: 128716725

  6. #6
    Frenzied Member Zaei's Avatar
    Join Date
    Jul 2002
    Location
    My own little world...
    Posts
    1,710
    Originally posted by petrus
    Should I do that manual?
    You have to.

    Z.

  7. #7

    Thread Starter
    Fanatic Member petrus's Avatar
    Join Date
    May 2002
    Location
    pBytes[sizeof(pBytes)/2]
    Posts
    553
    With a loop?
    ICQ: 128716725

  8. #8
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    All sorting algorithms have some kind of loop.

    You need to determine the order of your objects as seen by the viewer. Then sort them according to this order using some FAST!!! algorithm and draw them from back to front.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  9. #9

    Thread Starter
    Fanatic Member petrus's Avatar
    Join Date
    May 2002
    Location
    pBytes[sizeof(pBytes)/2]
    Posts
    553
    Couldn't I just do like this?
    I have a loop that draws the front triangles in order 1 to last triangle and when I've finished that I've a loop that goes backwards (triangle count to 1)??
    ICQ: 128716725

  10. #10
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    Uh... WHAT?

    Could you explain that again please? I don't understand.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  11. #11

    Thread Starter
    Fanatic Member petrus's Avatar
    Join Date
    May 2002
    Location
    pBytes[sizeof(pBytes)/2]
    Posts
    553
    I deleted a row.. that's why it didn't make any sense.
    ICQ: 128716725

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width