Results 1 to 5 of 5

Thread: is this a good way to...

  1. #1
    Senior Member Regular Contributor
    Join Date
    Mar 2002
    Location
    New Zealand
    Posts
    111

    is this a good way to...

    hi
    when i blend somthing, to make it be draw back to front i enable front culling,draw it, then enable back culling then draw it again. this is working fine for simple things like cubes etc but i was wondering would it be very practical on more complex objects? or will it be very slow and if it is how do i speed things up?
    thanx in advance

  2. #2
    Senior Member OpenGL Guru
    Join Date
    Feb 2000
    Location
    Sweden
    Posts
    2,978

    Re: is this a good way to...

    All triangles that are suppsed to be blended has to be sorted at the same time. Front or back facing, doesn't matter.

    Your technique will work as long as your object is convex and you have one object only. As soon as you have a concave object and/or multiple object, it won't work anymore.

    [This message has been edited by Bob (edited 11-09-2002).]

  3. #3
    Senior Member Regular Contributor
    Join Date
    Mar 2002
    Location
    New Zealand
    Posts
    111

    Re: is this a good way to...

    im not sure what you mean by concave and convex? and since im drawing the object twice will this slow things down if its a complex object?

    Originally posted by Bob:
    All triangles that are suppsed to be blended has to be sorted at the same time. Front or back facing, doesn't matter.

    Your technique will work as long as your object is convex and you have one object only. As soon as you have a concave object and/or multiple object, it won't work anymore.

    [This message has been edited by Bob (edited 11-09-2002).]

  4. #4
    Senior Member OpenGL Guru
    Join Date
    Feb 2000
    Location
    Sweden
    Posts
    2,978

    Re: is this a good way to...

    I don't really know how to describe convex and concave. But let's take an example. Draw a circle on a paper. Now, take a ruler and try to draw a line that intersects the circle more than two times. You will see that it's impossible. Any line can intersect the circle either zero or two times. Never four times, or one time. Therefore a circle is convex.

    A concave object, on the other hand, has a shape that lets the line intersect more than two times. Considet the shape of a C.
    Code :
    --------
    |      |
    |  -----
    |  |
    |  -----
    |      |
    --------
    Here you can draw a line that intersects the shape more than two times. Therefore this shape is considered a concave shape.

    Examples of convex shapes are spheres, cubes, cones and pyramids. Concave objects are, well, most objects with a somewhat complex shape.
    and since im drawing the object twice will this slow things down if its a complex object?
    Not that slow, but it will be some kind of performance hit. But as I said above, a complex objetc is likely to be concave, so your trick with drawing first back and then front faces won't work. You have to sort them.

  5. #5
    Member Newbie
    Join Date
    Nov 2002
    Location
    Germany
    Posts
    48

    Re: is this a good way to...

    Concave vs. convex test: Draw your polygon, then connect every point of it with each other. If one of the connection lines is outside of the polygon, it is concave.

    Knowledge is Power

Similar Threads

  1. Something good to think about
    By glfreak in forum OpenGL: Advanced Coding
    Replies: 2
    Last Post: 09-26-2004, 12:38 AM
  2. XP not good for sof II
    By in forum OpenGL: User Software
    Replies: 2
    Last Post: 12-30-2002, 03:18 PM
  3. Good for Golf?
    By in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 02-18-2002, 01:02 PM
  4. good websites
    By ravi2030 in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 08-22-2001, 12:32 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean