Results 1 to 9 of 9

Thread: Triangle fan

  1. #1
    Junior Member Newbie
    Join Date
    Feb 2000
    Location
    Porto Alegre, RS - Brasil
    Posts
    8

    Triangle fan

    I have made some code to optimize a mesh to a set of triangle fans, and it works very well. But when I use textures it have problems...

    I can realize why, but not realize how to solve (I think I can't), so my question is: Can I solve? If I do make triangles strips, will I have the same problem?

    Overall: If I am working with textures, the only way is to make just TRIANGLES? How can I optimize? HELP!

  2. #2
    Senior Member Frequent Contributor
    Join Date
    Feb 2000
    Location
    London
    Posts
    503

    Re: Triangle fan

    Well, we can't really offer suggestions without knowing what problem you were having...

    It's certainly possible to use textures with triangle fans.

  3. #3
    Junior Member Newbie
    Join Date
    Feb 2000
    Location
    Porto Alegre, RS - Brasil
    Posts
    8

    Re: Triangle fan

    Well, I check the faces and find the vertex that appears more. With this vertex I build a fan with all of the faces that are attached to that vertex, so I can build, for example, 5 faces making 7 glVertex calls. The idea sounds well for me, and works fine too (without textures).

    When I tested it with texures, I have founded that the same vertex can have different texture vertexes (I can have a vertex with 0,1 on a face and 1,1 on another face for the same vertex).

    So, how can I fix it? Maybe mapping on a different way on the software modeller? Or checking if the vertex changed the texture (but with too small fans)...

    What can I do?

  4. #4
    Senior Member Frequent Contributor
    Join Date
    Feb 2000
    Location
    France
    Posts
    880

    Re: Triangle fan

    Hi !

    If your shared vertex has different texture coordinates for two adjacent faces, you can not use any triangle fan/strip.

    When you are checking for shared vertices (i.e. X1=X2&&Y1=Y2&&Z1=Z2), you should also check that the texture coordinates are identical (add U1=U2&&V1=V2&&W1=W2).

    Of course, it will optimize a lot less your model but it is your only solution.

    Just a remark : you should try to build triangle strips instead of triangle fans. I believe that for most models, the result will be better.

    See ya.

    Eric

  5. #5
    Junior Member Newbie
    Join Date
    Feb 2000
    Location
    Porto Alegre, RS - Brasil
    Posts
    8

    Re: Triangle fan

    I know that strips are better, but I thought that beginning with fans would be easier.

    Well, I was making some tests and I can't believe on the results. Consider the following:

    operation = glNormal3fv + glTexCoord2f + glVertex3fv

    without fan (only triangles)
    1103 operations to draw the mesh in 26 ms

    With the fans
    551 operations to draw the mesh in 46 ms

    How could it took twice the time if it make a half of the operations? My display board accelerate triangles but not triangle fans? Is it possible?

    Why is this happening to me?

    I am almost giving up of that and getting just triangles.... If anyone can help me, I appreciate! Thanks for the support!

  6. #6
    Senior Member Regular Contributor
    Join Date
    Feb 2000
    Location
    milano, italy
    Posts
    282

    Re: Triangle fan

    it means that the application you wrote is spending more time to create triangle fans from the unstructured mesh than opengl to execute.

    so creating fans for THAT model is not needed, instead is better to avoid.

    probably, your model has too few primitives:
    your fanner should be prove useful when you have more primitives.

    again, what eric said is true, strips are better than fans for a generic model.
    strips can cover wider areas than fans.

    Dolo/\/\ightY
    Dolo/\/\ightY

  7. #7
    Member Contributor
    Join Date
    Feb 2000
    Location
    Italy
    Posts
    77

    Re: Triangle fan

    Originally posted by dmy:

    it means that the application you wrote is spending more time to create triangle fans from the unstructured mesh than opengl to execute.
    dmy, do you think he'd really done that??
    I hope that his timing results don't include
    model conversion, as this is a one-time procedure. It's evident that you call it before the main loop, in which rendering occurs. Why should you do differently?
    --
    Paolo M.

  8. #8
    Senior Member Regular Contributor
    Join Date
    Feb 2000
    Location
    milano, italy
    Posts
    282

    Re: Triangle fan

    i must admit i have no particular experience using structure optimizers... i was planning to build a realtime optimizer, but i didn't read any paper yet.

    i didn't thought about that, i assumed he's using the fanner in his heartbeat.
    and well, if he's not fanning in realtime yes, he have strange benchmarks !

    are optimizers used only as preprocessors?

    PS: paolom, about that specular map test, i have problems to route to the email you gave me.
    have you an other address?

    Dolo/\/\ightY
    Dolo/\/\ightY

  9. #9
    Junior Member Newbie
    Join Date
    Feb 2000
    Location
    Porto Alegre, RS - Brasil
    Posts
    8

    Re: Triangle fan

    Of course the timing was not counting the conversion time...

    Well, I can't understand, I ran a test on my home computer and it took 20 ms to draw with FANS and 26ms without fans (I have a V550 in home and a TNT on work, where I ran the first test). Besides, a friend of mine ran on his computer (without an accelerator board) and it took twice the time without fans that with fans.

    All this makes sense to me, cos my fans are making a good work, but I can't understand the results of the first test, described before, cos the chipset of my boards are the same... Can the Viper do fans better that TNT? Shouldn't...

    Anyway, I am tired of fans, I think I will begin to think on strips, I just wanted to learn more about optimizations with fans...

Similar Threads

  1. An alternative to triangle strips and triangle fans
    By vincoof in forum OpenGL: General
    Replies: 8
    Last Post: 10-26-2012, 04:04 AM
  2. Replies: 3
    Last Post: 10-09-2012, 09:39 PM
  3. triangle strip with a LINE triangle display error
    By Samme in forum OpenGL: Windows
    Replies: 22
    Last Post: 11-20-2008, 07:50 PM
  4. OT: fastest ray-triangle line -triangle intersection algo
    By V-man in forum OpenGL: Advanced Coding
    Replies: 23
    Last Post: 08-28-2002, 02:18 AM
  5. How to check triangle-triangle intersection?
    By alexlcm in forum OpenGL: Advanced Coding
    Replies: 2
    Last Post: 02-18-2001, 08:24 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