Help Wanted

This hurt my brain... Can you help me out? (Blitz Basic) – kurtp2003

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:

Graphics 800,600,16,2
SetBuffer BackBuffer()
Const upkey=200,rightkey=205,downkey=208,leftkey=203,space=57,bkey=48,f10=68,wkey=17,skey=31

Type lin
Field x#,y#,z#
Field x2#,y2#,z2#
Field xd#,yd#
Field xd2#,yd2#
Field s#,c#
Field s2#,c2#
Field h1#,h2#
Field xa#,xa2#,ya#,ya2#
Field d#,da#
Field d2#,d3#
Field d2_2,d3_2
Field d1_2#,da2#
Field p#,yaw#,r#
Field p2#,yaw2#,r2#
End Type

Type pivot
Field pitch#,yaw#,roll#
Field x#,y#,z#
Field xd#,yd#
Field s#,c#
Field h#
Field xa#,ya#
End Type

;create the point of rotation
piv.pivot=New pivot
piv\x=400
piv\y=300
piv\z=300

;create the wireframe
li.lin=New lin
li\x=300
li\y=250
li\z=100
li\x2=500
li\y2=250
li\z2=100

li.lin=New lin
li\x=300
li\y=350
li\z=100
li\x2=500
li\y2=350
li\z2=100

li.lin=New lin
li\x=300
li\y=250
li\z=100
li\x2=300
li\y2=350
li\z2=100

li.lin=New lin
li\x=500
li\y=250
li\z=100
li\x2=500
li\y2=350
li\z2=100

li.lin=New lin
li\x=300
li\y=250
li\z=500
li\x2=500
li\y2=250
li\z2=500

li.lin=New lin
li\x=300
li\y=350
li\z=500
li\x2=500
li\y2=350
li\z2=500

li.lin=New lin
li\x=300
li\y=250
li\z=500
li\x2=300
li\y2=350
li\z2=500

li.lin=New lin
li\x=500
li\y=250
li\z=500
li\x2=500
li\y2=350
li\z2=500

For piv.pivot=Each pivot
For li.lin=Each lin

;find distances from the point of rotation
li\d=Sqr((piv\x-li\x)^2+(piv\y-li\y)^2)
li\da=Sqr(li\d+(piv\z-li\z)^2)
li\d1_2=Sqr((piv\x-li\x2)^2+(piv\y-li\y2)^2)
li\da2=Sqr(li\d2+(piv\z-li\z2)^2)

li\d2=Sqr((piv\x-li\x)^2+(piv\z-li\z)^2)
li\d3=Sqr((piv\y-li\y)^2+(piv\z-li\z)^2)

li\d2=Sqr((piv\x-li\x2)^2+(piv\z-li\z2)^2)
li\d3_2=Sqr((piv\y-li\y2)^2+(piv\z-li\z2)^2)

;find relative pitch foe point1
li\p=ASin((piv\y-li\y)/li\d3)
If li\p<90 And li\p>-90
If li\y<piv\y
li\p=ACos((piv\z-li\z)/li\d3)
If li\z<piv\z Then li\p=-li\p
EndIf
EndIf

;find relative yaw for point1
li\yaw=ASin((piv\z-li\z)/li\d2)
If li\yaw<90 And li\yaw>-90
If li\z<piv\z
li\yaw=ACos((piv\x-li\x)/li\d2)
If li\z<piv\z Then li\yaw=-li\yaw
EndIf
EndIf

;find relative roll for point1
li\r=ASin((piv\x-li\x)/li\d)
If li\r<90 And li\r>-90
If li\x<piv\x
li\r=ACos((piv\y-li\y)/li\d)
If li\x<piv\x Then li\r=-li\r
EndIf
EndIf


;find relative pitch for point2
li\p2=ASin((piv\y-li\y2)/li\d3_2)
If li\p2<90 And li\p2>-90
If li\y2<piv\y
li\p2=ACos((piv\z-li\z2)/li\d3_2)
If li\z2<piv\z Then li\p2=-li\p2
EndIf
EndIf

;find relative yaw for point2
li\yaw2=ASin((piv\z-li\z2)/li\d2_2)
If li\yaw2<90 And li\yaw2>-90
If li\z2<piv\z
li\yaw2=ACos((piv\x-li\x2)/li\d2_2)
If li\z2<piv\z Then li\yaw2=-li\yaw2
EndIf
EndIf

;find relative roll for point2
li\r2=ASin((piv\x-li\x2)/li\d1_2)
If li\r2<90 And li\r2>-90
If li\x2<piv\x
li\r2=ACos((piv\y-li\y2)/li\d1_2)
If li\x2<piv\x Then li\r2=-li\r2
EndIf
EndIf

Next
Next

;main loop
While Not KeyHit(1)
Cls

For piv.pivot=Each pivot
;rotate all
piv\pitch=piv\pitch+.5
piv\yaw=piv\yaw+.5
piv\roll=piv\roll+.5

piv\xa=400
piv\ya=300
Plot piv\xa,piv\ya
Text 10,10,"Piv\xa = "+piv\xa+", Piv/ya = "+piv\ya
Next

For li.lin=Each lin
For piv.pivot=Each pivot

;find coords for point1
li\x=Cos(li\r+piv\roll)*li\da
li\y=Cos(li\p+piv\pitch)*li\da
li\z=Cos(li\yaw+piv\yaw)*li\da

;find coords for point2
li\x2=Cos(li\r2+piv\roll)*li\da2
li\y2=Cos(li\p2+piv\pitch)*li\da2
li\z2=Cos(li\yaw2+piv\yaw)*li\da2
Next

;figure out point1's absolute x and y (for rendering)
li\xd=400-li\x
li\yd=300-li\y
li\h1=Sqr(li\xd^2+li\yd^2)
li\s=li\xd/li\h1
li\c=li\yd/li\h1
li\xa=-1*(li\s*(li\h1/li\z/100))+400
li\ya=-1*(li\c*(li\h1/li\z/100))+300

;figure out point2's absolute x and y (for rendering)
li\xd2=400-li\x2
li\yd2=300-li\y2
li\h2=Sqr(li\xd2^2+li\yd2^2)
li\s2=li\xd2/li\h2
li\c2=li\yd2/li\h2
li\xa2=-1*(li\s2*(li\h2*(li\z2/100)))+400
li\ya2=-1*(li\c2*(li\h2*(li\z2/100)))+300

;draw a line between points one and two
Line li\xa,li\ya,li\xa2,li\ya2
Next


Flip
Wend
End


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:

Graphics 800,600,16,2
SetBuffer BackBuffer()
Const upkey=200,rightkey=205,downkey=208,leftkey=203,space=57,bkey=48,f10=68,wkey=17,skey=31
Const z=100

Type lin
Field x#,y#,z#
Field x2#,y2#,z2#
Field xd#,yd#
Field xd2#,yd2#
Field s#,c#
Field s2#,c2#
Field h1#,h2#
Field xa#,xa2#,ya#,ya2#
Field d#,da#
Field d2#,d3#
Field d2_2,d3_2
Field d1_2#,da2#
Field p#,yaw#,r#
Field p2#,yaw2#,r2#
End Type

Type pivot
Field pitch#,yaw#,roll#
Field x#,y#,z#
Field xd#,yd#
Field s#,c#
Field h#
Field xa#,ya#
End Type

;create the point of rotation
piv.pivot=New pivot
piv\x=400
piv\y=300
piv\z=300

;create the wireframe
li.lin=New lin
li\x=300
li\y=200
li\z=z+200
li\x2=500
li\y2=200
li\z2=z+200

li.lin=New lin
li\x=300
li\y=400
li\z=z+200
li\x2=500
li\y2=400
li\z2=z+200

li.lin=New lin
li\x=300
li\y=200
li\z=z+200
li\x2=300
li\y2=400
li\z2=z+200

li.lin=New lin
li\x=500
li\y=200
li\z=z+200
li\x2=500
li\y2=400
li\z2=z+200

li.lin=New lin
li\x=300
li\y=200
li\z=z+400
li\x2=300
li\y2=200
li\z2=z+400

li.lin=New lin
li\x=300
li\y=200
li\z=z+400
li\x2=500
li\y2=200
li\z2=z+400

li.lin=New lin
li\x=300
li\y=200
li\z=z+400
li\x2=300
li\y2=400
li\z2=z+400

li.lin=New lin
li\x=500
li\y=200
li\z=z+400
li\x2=500
li\y2=400
li\z2=z+400

li.lin=New lin
li\x=300
li\y=200
li\z=z+100
li\x2=300
li\y2=200
li\z2=z+400

li.lin=New lin
li\x=500
li\y=200
li\z=z+200
li\x2=500
li\y2=200
li\z2=z+400

li.lin=New lin
li\x=300
li\y=400
li\z=z+200
li\x2=300
li\y2=400
li\z2=z+400

li.lin=New lin
li\x=500
li\y=400
li\z=z+200
li\x2=500
li\y2=400
li\z2=z+400

For piv.pivot=Each pivot
For li.lin=Each lin

;find distances from the point of rotation
li\d=Sqr((piv\x-li\x)^2+(piv\y-li\y)^2)
li\da=Sqr(li\d+(piv\z-li\z)^2)
li\d1_2=Sqr((piv\x-li\x2)^2+(piv\y-li\y2)^2)
li\da2=Sqr(li\d1_2+(piv\z-li\z2)^2)

li\d2=Sqr((piv\x-li\x)^2+(piv\z-li\z)^2)
li\d3=Sqr((piv\y-li\y)^2+(piv\z-li\z)^2)

li\d2_2=Sqr((piv\x-li\x2)^2+(piv\z-li\z2)^2)
li\d3_2=Sqr((piv\y-li\y2)^2+(piv\z-li\z2)^2)

;find relative pitch foe point1
li\p=ASin((piv\y-li\y)/li\d3)
If li\p<90 And li\p>-90
If li\y<piv\y
li\p=ACos((piv\z-li\z)/li\d3)
If li\z<piv\z Then li\p=-li\p
EndIf
EndIf

;find relative yaw for point1
li\yaw=ASin((piv\z-li\z)/li\d2)
If li\yaw<90 And li\yaw>-90
If li\z<piv\z
li\yaw=ACos((piv\x-li\x)/li\d2)
If li\z<piv\z Then li\yaw=-li\yaw
EndIf
EndIf

;find relative roll for point1
li\r=ASin((piv\x-li\x)/li\d)
If li\r<90 And li\r>-90
If li\x<piv\x
li\r=ACos((piv\y-li\y)/li\d)
If li\x<piv\x Then li\r=-li\r
EndIf
EndIf


;find relative pitch for point2
li\p2=ASin((piv\y-li\y2)/li\d3_2)
If li\p2<90 And li\p2>-90
If li\y2<piv\y
li\p2=ACos((piv\z-li\z2)/li\d3_2)
If li\z2<piv\z Then li\p2=-li\p2
EndIf
EndIf

;find relative yaw for point2
li\yaw2=ASin((piv\z-li\z2)/li\d2_2)
If li\yaw2<90 And li\yaw2>-90
If li\z2<piv\z
li\yaw2=ACos((piv\x-li\x2)/li\d2_2)
If li\z2<piv\z Then li\yaw2=-li\yaw2
EndIf
EndIf

;find relative roll for point2
li\r2=ASin((piv\x-li\x2)/li\d1_2)
If li\r2<90 And li\r2>-90
If li\x2<piv\x
li\r2=ACos((piv\y-li\y2)/li\d1_2)
If li\x2<piv\x Then li\r2=-li\r2
EndIf
EndIf

Next
Next

;main loop
While Not KeyHit(1)
Cls

For piv.pivot=Each pivot
;rotate all
piv\pitch=piv\pitch+.5
piv\yaw=piv\yaw+.5
piv\roll=piv\roll+.5

piv\xa=400
piv\ya=300
Plot piv\xa,piv\ya
Next

For li.lin=Each lin
For piv.pivot=Each pivot

;find coords for point1
li\x=Cos(li\r+piv\roll)*li\da+400
li\y=Cos(li\p+piv\pitch)*li\da+300
li\z=Cos(li\yaw+piv\yaw)*li\da

;find coords for point2
li\x2=Cos(li\r2+piv\roll)*li\da2+400
li\y2=Cos(li\p2+piv\pitch)*li\da2+300
li\z2=Cos(li\yaw2+piv\yaw)*li\da2
Next

;figure out point1's absolute x and y (for rendering)
li\xd=400-li\x
li\yd=300-li\y
li\h1=Sqr(li\xd^2+li\yd^2)
li\s=li\xd/li\h1
li\c=li\yd/li\h1
li\xa=-1*(li\s*(li\h1/(li\z/100)))+400
li\ya=-1*(li\c*(li\h1/(li\z/100)))+300

;figure out point2's absolute x and y (for rendering)
li\xd2=400-li\x2
li\yd2=300-li\y2
li\h2=Sqr(li\xd2^2+li\yd2^2)
li\s2=li\xd2/li\h2
li\c2=li\yd2/li\h2
li\xa2=-1*(li\s2*(li\h2/(li\z2/100)))+400
li\ya2=-1*(li\c2*(li\h2/(li\z2/100)))+300

;draw a line between points one and two
Line li\xa,li\ya,li\xa2,li\ya2
Next


Flip
Wend
End


[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.

------------------
yeah, im a little crazy

Blessed are those who suffer for doing what is right.
The kingdom of heaven belongs to them.-Matthew 5:10

PM ME YOUR DESCRIPTION OF ME! ILL PUT IT HERE!

Here's all the comments!

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.

------------------
#include <spazz.h>
int name()
{
char name['B','u','d','d','B','o''y']
}
-----------------------
MMMM... I love pi!!

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:

;find relative pitch foe point1
li\p=ASin((piv\y-li\y)/li\d3)
If li\p<90 And li\p>-90
If li\y<piv\y
li\p=ACos((piv\z-li\z)/li\d3)
If li\z<piv\z Then li\p=-li\p
EndIf
EndIf

;find relative yaw for point1
li\yaw=ASin((piv\z-li\z)/li\d2)
If li\yaw<90 And li\yaw>-90
If li\z<piv\z
li\yaw=ACos((piv\x-li\x)/li\d2)
If li\z<piv\z Then li\yaw=-li\yaw
EndIf
EndIf

;find relative roll for point1
li\r=ASin((piv\x-li\x)/li\d)
If li\r<90 And li\r>-90
If li\x<piv\x
li\r=ACos((piv\y-li\y)/li\d)
If li\x<piv\x Then li\r=-li\r
EndIf
EndIf


;find relative pitch for point2
li\p2=ASin((piv\y-li\y2)/li\d3_2)
If li\p2<90 And li\p2>-90
If li\y2<piv\y
li\p2=ACos((piv\z-li\z2)/li\d3_2)
If li\z2<piv\z Then li\p2=-li\p2
EndIf
EndIf

;find relative yaw for point2
li\yaw2=ASin((piv\z-li\z2)/li\d2_2)
If li\yaw2<90 And li\yaw2>-90
If li\z2<piv\z
li\yaw2=ACos((piv\x-li\x2)/li\d2_2)
If li\z2<piv\z Then li\yaw2=-li\yaw2
EndIf
EndIf

;find relative roll for point2
li\r2=ASin((piv\x-li\x2)/li\d1_2)
If li\r2<90 And li\r2>-90
If li\x2<piv\x
li\r2=ACos((piv\y-li\y2)/li\d1_2)
If li\x2<piv\x Then li\r2=-li\r2
EndIf


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:

;find relative pitch for point1
li\p=ASin((piv\y-li\y)/li\d3)
If li\p<90 And li\p>-90
If li\y<piv\y
li\p=ACos((piv\z-li\z)/li\d3)
If li\y<piv\y Then li\p=-li\p
EndIf
EndIf

;find relative yaw for point1
li\yaw=ASin((piv\z-li\z)/li\d2)
If li\yaw<90 And li\yaw>-90
If li\z<piv\z
li\yaw=ACos((piv\x-li\x)/li\d2)
If li\z<piv\z Then li\yaw=-li\yaw
EndIf
EndIf

;find relative roll for point1
li\r=ASin((piv\x-li\x)/li\d)
If li\r<90 And li\r>-90
If li\x<piv\x
li\r=ACos((piv\y-li\y)/li\d)
If li\x<piv\x Then li\r=-li\r
EndIf
EndIf


;find relative pitch for point2
li\p2=ASin((piv\y-li\y2)/li\d3_2)
If li\p2<90 And li\p2>-90
If li\y2<piv\y
li\p2=ACos((piv\z-li\z2)/li\d3_2)
If li\y2<piv\y Then li\p2=-li\p2
EndIf
EndIf

;find relative yaw for point2
li\yaw2=ASin((piv\z-li\z2)/li\d2_2)
If li\yaw2<90 And li\yaw2>-90
If li\z<piv\z
li\yaw2=ACos((piv\x-li\x2)/li\d2_2)
If li\z2<piv\z Then li\yaw2=-li\yaw2
EndIf
EndIf

;find relative roll for point2
li\r2=ASin((piv\x-li\x2)/li\d1_2)
If li\r2<90 And li\r2>-90
If li\x2<piv\x
li\r2=ACos((piv\y-li\y2)/li\d1_2)
If li\x2<piv\x Then li\r2=-li\r2
EndIf
EndIf


[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:
Originally posted by Mack:
Krylar knows some Blitz...

Didn't he write a book or something?

------------------
quit posting on CCN? nope. I havn't been driven off yet.

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.


;main loop
While Not KeyHit(1)
Cls

For piv.pivot=Each pivot
;rotate all
piv\pitch=piv\pitch+.5
piv\yaw=piv\yaw+.5
piv\roll=piv\roll+.5

piv\xa=400
piv\ya=300
Plot piv\xa,piv\ya
Next

; setup a quick var for Y text processing
iTextY = 0;
For li.lin=Each lin
For piv.pivot=Each pivot

;find coords for point1
li\x=Cos(li\r+piv\roll)*li\da+400
li\y=Cos(li\p+piv\pitch)*li\da+300
li\z=Cos(li\yaw+piv\yaw)*li\da

;find coords for point2
li\x2=Cos(li\r2+piv\roll)*li\da2+400
li\y2=Cos(li\p2+piv\pitch)*li\da2+300
li\z2=Cos(li\yaw2+piv\yaw)*li\da2
Next

;figure out point1's absolute x and y (for rendering)
li\xd=400-li\x
li\yd=300-li\y
li\h1=Sqr(li\xd^2+li\yd^2)
li\s=li\xd/li\h1
li\c=li\yd/li\h1
li\xa=-1*(li\s*(li\h1/(li\z/100)))+400
li\ya=-1*(li\c*(li\h1/(li\z/100)))+300

;figure out point2's absolute x and y (for rendering)
li\xd2=400-li\x2
li\yd2=300-li\y2
li\h2=Sqr(li\xd2^2+li\yd2^2)
li\s2=li\xd2/li\h2
li\c2=li\yd2/li\h2
li\xa2=-1*(li\s2*(li\h2/(li\z2/100)))+400
li\ya2=-1*(li\c2*(li\h2/(li\z2/100)))+300

;draw a line between points one and two
Line li\xa,li\ya,li\xa2,li\ya2

; print out some debug info (the li\ID would be the ID of the line so you know which it is...
; you'll have to add this ID to your Type and do assigns...assuming you want to)
Text 0,iTextY,"Line=" + li\ID + ",XA=" + li\xa + ",YA=" + li\ya + ",XA2=" + li\xa2 + ",YA2=" + li\xa2
; increase the Y position of the text write
iTextY = iTextY + 16
Next

Flip
; wait for the key press so we can see what the values are before the next calculation
WaitKey()
Wend

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.


; create the file
hFile = WriteFile("linedata.txt")

;main loop
For iLoop = 1 to 25
Cls
; setup the header for this dataset
Header$ = "Sequence " + iLoop + " of 25";
WriteLine(hFile,"---------------------------------------")
WriteLine(hFile,Header$)
WriteLine(hFile,"---------------------------------------")
For piv.pivot=Each pivot
;rotate all
piv\pitch=piv\pitch+.5
piv\yaw=piv\yaw+.5
piv\roll=piv\roll+.5

piv\xa=400
piv\ya=300
Plot piv\xa,piv\ya
Next

For li.lin=Each lin
For piv.pivot=Each pivot

;find coords for point1
li\x=Cos(li\r+piv\roll)*li\da+400
li\y=Cos(li\p+piv\pitch)*li\da+300
li\z=Cos(li\yaw+piv\yaw)*li\da

;find coords for point2
li\x2=Cos(li\r2+piv\roll)*li\da2+400
li\y2=Cos(li\p2+piv\pitch)*li\da2+300
li\z2=Cos(li\yaw2+piv\yaw)*li\da2
Next

;figure out point1's absolute x and y (for rendering)
li\xd=400-li\x
li\yd=300-li\y
li\h1=Sqr(li\xd^2+li\yd^2)
li\s=li\xd/li\h1
li\c=li\yd/li\h1
li\xa=-1*(li\s*(li\h1/(li\z/100)))+400
li\ya=-1*(li\c*(li\h1/(li\z/100)))+300

;figure out point2's absolute x and y (for rendering)
li\xd2=400-li\x2
li\yd2=300-li\y2
li\h2=Sqr(li\xd2^2+li\yd2^2)
li\s2=li\xd2/li\h2
li\c2=li\yd2/li\h2
li\xa2=-1*(li\s2*(li\h2/(li\z2/100)))+400
li\ya2=-1*(li\c2*(li\h2/(li\z2/100)))+300

;draw a line between points one and two
Line li\xa,li\ya,li\xa2,li\ya2

; print out some debug info to the file (the li\ID would be the ID of the line so you know which it is...
; you'll have to add this ID to your Type and do assigns...assuming you want to)
LineData$ = "Line=" + li\ID + ", XA=" + li\xa + ",YA=" + li\ya + ",XA2=" + li\xa2 + ",YA2=" + li\xa2
WriteLine(hFile,LineData$)
Next
WriteLine(hFile,"--End of Sequence--")
WriteLine(hFile," ")

Flip
Next

CloseFile(hFile)

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:
Originally posted by krylar:
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


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....