Author Topic: Polyvector Question  (Read 1388 times)

Offline fuzzy70

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 828
  • Look left, Look right, LOOK OUT!!
    • View Profile
Polyvector Question
« on: 2013-Dec-03 »
I'm messing about with POLYVECTORS again & my question is about MODE 2 STRIP (incorrectly doubled up as MODE 1 with triangles for as long as I can remember in the help file hint hint lol).

I won't say exactly what I am doing as have a few ideas floating around but can give an example of what I mean.

Imagine say I wanted to show a 6 digit score and all my 0-9 digits are on a simple texture map, getting the texture co-ords for each digit is straight forward enough & that I understand no problem. However because each digit is effectively a quad, after plotting the 1st POLYVECTOR with 4 points the next one shares the previous ones last 2 points which throws the texture co-ords out of sync.

Currently I am using POLYNEWSTRIP after each quad is plotted to basically reset the texture co-ords & draw subsequent POLY's. Basically I'm just after confirmation that I am doing it the right way & not misunderstanding the STRIP mode. If I am then what practical uses are there for STRIP mode using triangles?.

Please don't think I am being ignorant, it's just me wanting a better understanding of that mode using triangles & it's usage with regards to textures as my brain is not seeing it  :D.

Lee
"Why don't you just make ten louder and make ten be the top number and make that a little louder?"
- "These go to eleven."

This Is Spinal Tap (1984)

Offline Emil

  • Mr. Drawsprite
  • **
  • Posts: 64
    • View Profile
Re: Polyvector Question
« Reply #1 on: 2013-Dec-03 »
I think I understand what you mean and Yes, I would do the same thing.
Strip mode and such is excellent for landscapes (3d heightmap) and stuff where you want the uv coordinates to be the same, on the same position.

In your case you do want different uvs, on the same positions, so strip mode fails.

For my, 2D tilebased, game I use single triangles. Basically I put every triangle in a big array and when I'm ready to render everything I use a separate function that does everything (Some bugs can be avoided if I render all polys at the same time).
Anybody got a better solution?

Offline fuzzy70

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 828
  • Look left, Look right, LOOK OUT!!
    • View Profile
Re: Polyvector Question
« Reply #2 on: 2013-Dec-04 »
Thanks Emil.

I understand using triangles in 3D as been using 3D packages as far back as the Amiga days along with 3D games etc. What I don't really get is their usefulness in 2D as such. I can think of using mode 0 FAN as being useful for drawing quick filled circles & hex grids, can't think of the top of my head why I would need or use mode 1 TRIANGLES in 2D & the same goes for mode 2 STRIP (if it wasn't for the POLYNEWSTRIP command to effectively make them quads with 4 uv's for the texture).

I think my problem is being so used to seeing/using triangles in 3D that my brain can't grasp their use in 2D  :giveup:

You mentioned your 2D tilebased game uses single triangles & the 1st thing that pops in my head is "How on earth does that work with single triangles", if you said "I use pairs of triangles to make a quad" then that I can picture no problem  :D.

Age is getting the better of me I think  O_O

Lee
"Why don't you just make ten louder and make ten be the top number and make that a little louder?"
- "These go to eleven."

This Is Spinal Tap (1984)

Offline Emil

  • Mr. Drawsprite
  • **
  • Posts: 64
    • View Profile
Re: Polyvector Question
« Reply #3 on: 2013-Dec-04 »
well it's triangles constructing quads of course.., :)

anyways.., I used fan and strip when doing my drawings of circles and such... mostly because it means less code for me.



Offline fuzzy70

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 828
  • Look left, Look right, LOOK OUT!!
    • View Profile
Re: Polyvector Question
« Reply #4 on: 2013-Dec-04 »
Thanks for that Emil  :good:

That clears up quite a few things & makes sense  :booze:. Nice particles BTW  :good:

Lee

"Why don't you just make ten louder and make ten be the top number and make that a little louder?"
- "These go to eleven."

This Is Spinal Tap (1984)