Thread: clipping triangles.

  1. #1
    Registered User
    Join Date
    Sep 2004
    Posts
    3

    clipping triangles.

    hello im new to this forum so please bear with me,
    i have been looking for some help on clipping triangles,everything i have found is written in c,and i dont use c myself,but i know that c can make lib for qbasic,hence why im here,if anyone would be able to help me,please do,i have lots of links for c code that clips the screen properly,and i just need it made into a qb lib? is that possible? alls that i need is the triangle points moved ,and maybe i would be able to use the result of the percentage clipped to do the math for the texture source clip. ive already posted for help in other forums,and most people dont have a clue what im talking about!!! hehehe

  2. #2
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,897
    >ive already posted for help in other forums,and most people dont have a clue what im talking about!!! hehehe
    I can sympathize with them. Bad grammar coupled with an incredibly vague question isn't conducive to getting prompt help.
    My best code is written with the delete key.

  3. #3
    Crazy Fool Perspective's Avatar
    Join Date
    Jan 2003
    Location
    Canada
    Posts
    2,640
    It's not hard to implement a simple clipping algo (even in qbasic id assume). Look up the Sutherland-Hodgeman clipping algorithm (yes, algorithm, not C code) and start from there.

  4. #4
    Registered User
    Join Date
    Sep 2004
    Posts
    3
    thanbks perspective,i looked it up but could only find c code for it

  5. #5
    Registered User
    Join Date
    Apr 2002
    Posts
    1,571
    go to http://www.flipcode.com/tutorials/tut_clipping.shtml

    Scroll down to "Sutherland-Hodgeman Clipping"
    "...the results are undefined, and we all know what "undefined" means: it means it works during development, it works during testing, and it blows up in your most important customers' faces." --Scott Meyers

  6. #6
    Crazy Fool Perspective's Avatar
    Join Date
    Jan 2003
    Location
    Canada
    Posts
    2,640
    Quote Originally Posted by thesanman112
    thanbks perspective,i looked it up but could only find c code for it
    try here,
    http://hpcc.engin.umich.edu/CFD/user...ml/node90.html

  7. #7
    Registered User Frobozz's Avatar
    Join Date
    Dec 2002
    Posts
    546
    Quote Originally Posted by thesanman112
    but i know that c can make lib for qbasic
    C can be used for that but not the ones mentioned under the compiler list on the main page of this site. The only version of C I know of that might be able to do this is Microsoft Quick C.

    My advise to you is to drop QBasic. Don't take this as a "QBasic is crap and sucks switch to C" bit of advise, I used to use QBasic constantly and I know it is a fairly decent language for being 16-bit and DOS. The reason I say drop it is that you aren't going to get very far with 3d graphics in it for a number of reasons with the two biggest reasons being speed and memory limitations.

    If you're switching from QBasic I'd recommend MinGW. The reason is that it is command prompt and, as it always seems to be, QBasic people are good with the command prompt. The tutorials on this site are okay but not the greatest so it'd probably be best to check a library or bookstore for a book of some sort (I personally used "The Complete Idiot's Guide to C++" and I also used one of the Sams 21 days books).

  8. #8
    Registered User
    Join Date
    Sep 2004
    Posts
    3
    well if your interested in what i have done,ive made a game,fps,full modeling,sorting,ect,ect

    heres the links
    http://qbtk.com/phpBB2/viewtopic.php?t=536 3d editor
    http://qbtk.com/phpBB2/viewtopic.php?t=257 3d game

    i know all about qbasic probs,ive used basic for like 20 years how can i switch to something else when i can program with qb while im sleeping!!!!! hahahha

  9. #9
    ---
    Join Date
    May 2004
    Posts
    1,379
    if you can program basic that well then c would be a breeze to learn and you would never look back.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 3
    Last Post: 07-08-2009, 10:13 AM
  2. Clipping in Direct3D
    By VirtualAce in forum Game Programming
    Replies: 7
    Last Post: 11-24-2004, 01:33 AM
  3. 2D Clipping
    By Duetti in forum Game Programming
    Replies: 10
    Last Post: 12-04-2003, 12:45 AM
  4. Clipping plane prob?
    By gazsux in forum Game Programming
    Replies: 7
    Last Post: 07-04-2003, 09:49 PM
  5. 3D clipping & gluPerspective()
    By Perspective in forum Game Programming
    Replies: 8
    Last Post: 02-22-2003, 10:40 AM