kurtp2003 Member Posts: 48 From: minnesota, US Registered: 01-20-2006 |
Hey, Lately, I've been trying to write a program that will render a rotating wireframe but using only 2D commands... I think my method of finding coords and converting them to 2D ones is basically right, but I can't get it to work.... Can someone help? Here is the code: quote: |
||
kurtp2003 Member Posts: 48 From: minnesota, US Registered: 01-20-2006 |
Originally posted by kurtp2003: Hey, Lately, I've been trying to write a program that will render a rotating wireframe but using only 2D commands... I think my method of finding coords and converting them to 2D ones is basically right, but I can't get it to work.... Can someone help? *EDIT* I updated the source code. If you run it, you'll see just how close I am to getting this right. However, if this was doing what I want it to be doing, you would see a rotating cube at the center of the screen, but you cleary don't *EDIT#2* I fixed some more problems, and apparently created a few new ones *EDIT#3* It very nearly works now, except certain points seem to be "stuck" in one position, and I'm not sure why. Here is the code: quote: [This message has been edited by kurtp2003 (edited August 25, 2006).] [This message has been edited by kurtp2003 (edited August 25, 2006).] [This message has been edited by kurtp2003 (edited August 25, 2006).] |
||
Realm Master![]() Member Posts: 1971 From: USA Registered: 05-15-2005 |
I read the first two lines and realized something. Your way smarter than me. Maybe Han CLinto can help you out. ------------------ Blessed are those who suffer for doing what is right. PM ME YOUR DESCRIPTION OF ME! ILL PUT IT HERE! P.S. I HATE 640x480!!!!!! |
||
kurtp2003 Member Posts: 48 From: minnesota, US Registered: 01-20-2006 |
Just because I know more advanced math doesn't make me smarter. Besides, if remember right, your a few years younger than me, so don't worry, you'll get there. |
||
buddboy![]() Member Posts: 2220 From: New Albany, Indiana, U.S. Registered: 10-08-2004 |
lol, wow. probably Firemaker103 could help you with this, and especially Han Clinto for the math part. ------------------ |
||
Mack![]() Administrator Posts: 2779 From: Registered: 01-20-2001 |
Krylar knows some Blitz, I'll drop him an email to this thread. | ||
kurtp2003 Member Posts: 48 From: minnesota, US Registered: 01-20-2006 |
okay, cool The code here isn't quite current, but it's close enough to what I have now. Edit: I beleive that most of the problem lies in this part: quote: And, not by cooincidence, this is pretty much the only part of the code that has undergone any changes. Edit 2:Here is the most recent version of that paricular piece of code: quote: [This message has been edited by kurtp2003 (edited August 26, 2006).] [This message has been edited by kurtp2003 (edited August 26, 2006).] |
||
crazyishone![]() Member Posts: 1685 From: Registered: 08-25-2004 |
quote: Didn't he write a book or something? ------------------ |
||
Krylar![]() Administrator Posts: 502 From: MD, USA Registered: 03-05-2001 |
Hiya, It's been forever since doing this stuff to be honest, and even then I was mostly a 2D guy. I would say the best place to find help would be at www.blitzbasic.com. Barring that, you may get some help at www.codersworkshop.com. One of the things that would help you debug the problem, though, would be to put in a bunch of TEXT statements in your main loop. Do a single step and see how the values are being updated.
If that puts up too much data and you'd rather have it on a line-by-line basis, then you could just move the Flip and WaitKey() up under the Text statment (inside the For loop). An even better way would be to use File commands and print out like 25 groups of data to a file and then close the program.
Again, it's been a long time since I've played with BB and I don't even have it installed so the above is all from memory. Thus, it may need some tweaking. I know this doesn't solve your problem but it may assist you in finding out where the problem is. All the best. -Krylar ------------------ |
||
kurtp2003 Member Posts: 48 From: minnesota, US Registered: 01-20-2006 |
Yeah, I guess I should do that. The only reason I didn't before is because that's alot of debug info to sift through. I guess it's about time I made a debug menu or something. On a side note, I know that the math for the renderer isn't perfect, but it really shouldn't be noticeable because I'm trying to draw a cube. |
||
Krylar![]() Administrator Posts: 502 From: MD, USA Registered: 03-05-2001 |
I wouldn't know the math behind it anyway, so your method is better than I could do. Hope you get it figured out! -Krylar ------------------ |
||
kurtp2003 Member Posts: 48 From: minnesota, US Registered: 01-20-2006 |
quote: I bet you could. Really. I don't know anything more advanced than high school geometry. (That's because I haven't even started my sophmore year yet) You must know more than me.... |