Author Topic: Simple Polygon Rotator  (Read 3294 times)

0 Members and 1 Guest are viewing this topic.

Offline bfr

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 819
  • Rating: +4/-0
    • View Profile
    • bfr's website
Simple Polygon Rotator
« on: July 10, 2007, 11:24:00 am »
I originally was going to make a program that could draw rotated 3-D prisms, but it turns out that somebody already made that, so because I didn't want to waste the code I already have, I turned it into something that can draw any polygon rotated at any angle.  It's for the TI-89/Ti-92+/Voyage 200, and was written in C.

I didn't do much testing with it, but it should work.  The only thing you have to worry about is you need to make sure you use it correctly, or else it can crash your calculator.  Here is how to use it:

prism(row,column,angleInDegrees,mode,point1x,point1y,point2x,point2y,...)

It definitely should be fast enough.  All of the parameters are integers.  Here are the different mode settings:

0 - reverse
1 - normal
2 - xor
4 - replace
5 - or

To download this, see the attachment.

EDIT:  I decided to do some additional testing and realized I made a dumb mistake.  The latest attachment has this fixed.

Fallen Ghost

  • Guest
Simple Polygon Rotator
« Reply #1 on: July 10, 2007, 01:07:00 pm »
Hey, I could do that on my 83+ with my draw3d program on ticalc. And it even allowed surface shadings, lines, points, perspective/isometric, built-in editor, rotations/scale, and all that, with object that may be other than prisms.

But I admit it weighted 6k of RAM and didn't patterns like or/xor/and.

[Edit]http://www.ticalc.org/archives/files/fileinfo/395/39556.html

Offline bfr

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 819
  • Rating: +4/-0
    • View Profile
    • bfr's website
Simple Polygon Rotator
« Reply #2 on: July 10, 2007, 02:04:00 pm »
Yeah, I would have had a lot of stuff like that, but I found at that somebody already made it.  I'd be interested in seeing your version for the TI-83+ though.  :)smile.gif

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55941
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Simple Polygon Rotator
« Reply #3 on: July 26, 2007, 01:14:00 am »
i wonder if this could be used as a lib for other programmers?

Fallen Ghost

  • Guest
Simple Polygon Rotator
« Reply #4 on: July 26, 2007, 01:34:00 am »
Double post ftw!

Well, I guess the 68k basic has a prgmXXX simile, so that should be possible, like bfr explained with it's special new function

tenniskid493

  • Guest
Simple Polygon Rotator
« Reply #5 on: July 26, 2007, 10:32:00 am »
I don't see a double post :Dbiggrin.gifYour welcome DJ_Omnimaga

Nice work bfr...now if only you put this effort towards your other projects :Ptongue.gif  (cough*OmnimagaTheRPG*cough)