I want to use "stripe" (http://www.cs.sunysb.edu/~stripe/) to convert my
3d models from triangles to triangle strips. Stripe takes the .obj-file
format (by Wavefront) and returns ".objf" files.
So, I have two questions ...
.objf is similar to .obj with some additional identifiers:
t for triangle strip
q for a continuation of a triangle strip
So what is the difference between t and q? Isn't
t 10 9 8 4 2
the same as
t 10 9 8 # Start of triangle strip 1
q 4 # Continuation of triangle strip 1
q 2 # Continuation of triangle strip 1
??????
(taken from the file format example at the stripe homepage)
Why is there an explicit given continuation? A strip just contains
single vertices where the first two are treatend specially, isn't it?
My second questions concerns the other file format example at the stipe
page:
t 3 4 3 5 # Start of triangle strip 2
q 6 7 # Continuation of triangle strip 2
Why is there a "3 4 3" at the start? I've seen this some other times and
in my tests too. So this isn't a triangle at all? What's that? A bug?
To sum up my questions:
1.) Why is there a thing like "q"? I think it isn't necessary because it
can be also a single "t" line.
2.) That's this strange repetition (like "3 4 3"). This doesn't define a
correct triangle?
thanks in advance
markus
p.s.: Forgive me. I know this isn't really OpenGL ... but close to.
> I want to use "stripe" (http://www.cs.sunysb.edu/~stripe/) to convert my
> 3d models from triangles to triangle strips. Stripe takes the .obj-file
> format (by Wavefront) and returns ".objf" files.
I've been using stripe to generate strips for a project I'm involved in,
and it hasn't been a pleasent experience. Stripe has bugs, two that
immediately comes to mind are:
support for texture coordinates is broken. For some reason your model
needs to contain quads here and there for texture coordinates to be
propagated through. The situation may be the same for normals, I don't
know.
The orientation check sometimes fails for odd models, causing stripe to
create strips that at some point reverses the triangles from their
original orientation/winding.
> So, I have two questions ...
>
> .objf is similar to .obj with some additional identifiers:
> t for triangle strip
> q for a continuation of a triangle strip
>
> So what is the difference between t and q? Isn't
> t 10 9 8 4 2
> the same as
> t 10 9 8 # Start of triangle strip 1
> q 4 # Continuation of triangle strip 1
> q 2 # Continuation of triangle strip 1
It's exactly the same.
> Why is there an explicit given continuation? A strip just contains
> single vertices where the first two are treatend specially, isn't it?
There's nothing special about the first two vertices.
> My second questions concerns the other file format example at the stipe
> page:
>
> t 3 4 3 5 # Start of triangle strip 2
> q 6 7 # Continuation of triangle strip 2
>
> Why is there a "3 4 3" at the start? I've seen this some other times and
> in my tests too. So this isn't a triangle at all? What's that? A bug?
3 4 3 is a degenerate triangle that effectively causes a "swap".
Normally when you start stripping in a particular direction, you don't
have a choice as to which direction the strip should turn in, ie. there
are no options, there is only one edge that the next triangle in the
strip can be connected at. If you want the strip to turn in another
direction you have to make a swap, which means that the next triangle in
the strip will be connected at the other edge (not counting the edge
that connects the triangle to the rest of the strip there are two
remaining edges) of the triangle.
degenerate triangles, or null triangles, are not "magic" in the respect
that they are treated differently by OpenGL than other triangles. They
simply permit the strip to continue in another direction.
A swap costs only one vertex, while starting a new strip costs two. If
you decide to use Stripe, you'll probably get better strips by asking
stripe to try to limit the number of swaps.
>
> To sum up my questions:
> 1.) Why is there a thing like "q"? I think it isn't necessary because it
> can be also a single "t" line.
I dunno.
> 2.) That's this strange repetition (like "3 4 3"). This doesn't define a
> correct triangle?
It's a swap. If you think my explanation sucks, which it does, go search
for strips on SGI's website. They've got a decent explanation somewhere
- with sketches, which helps a lot.
Best regards,
Thomas
--
Logic is a systematic method of coming to the wrong conclusion with
confidence.
Do you know some other (better) tool to generate triangle strips? Or is
there some source code out there? I havn't found anything and I *don't*
wanna read the theoretical stuff and do it all by myself.
> [...]
Thanks for your reply again
markus
At least one site has source code for "greedy triangle stripping" - try
searching for that. I haven't looked at it, but I suspect it's very
simple, and doesn't take normals and texture coordinates in to account,
and then you may be better of with Stripe.
I also found a website (scandinavian domain .dk, .se, .no or .fi, I
think) that presented a paper on another algorithm. They didn't have any
source code, but you could request a windows binary. Shouldn't be too
dificult to find.
Sorry I can't be more helpful.