Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / Box command; confusing

Author
Message
Yskonyn
21
Years of Service
User Offline
Joined: 19th Dec 2002
Location: Netherlands
Posted: 10th Feb 2006 13:05 Edited at: 10th Feb 2006 13:07
I have a little trouble here with the 'simple' box command.
The syntax help in the IDE says: Left, Top, Right, Bottom, so
BOX 100,100,100,100 makes all the sides of the box 100 units, right? No it doesn't and I can see why, because in this case you won't tell the program WHERE the box should be drawn (no coordinates).

In the helpfile, though, another explanation is given:
x1, y1, x2, y2 are what the numbers will tell the computer.

Here comes the confusing part: if it's x1,y1,x2,y2 won't you only have 2 coordinates on-screen?
x1,y1 defines one point on-screen and x2,y2 the other, so how does this translate into a box? As far as I can see this would make a line instead of a box.

Looking a bit further I came across the 'The Basics of DBPro Tutorial' by Joseph Thomson (very good by the way!) and he says the box command: "(...) The box has the coordinates of the opposite corners (...)", still this doesn't make sense if you only have two x values and two y values, which would implicate only two coordinates on-screen as discussed above...

Obviously I am overlooking the obvious, but I seem to be running around in my own thought circle here, could someone please shed some light?



Yskonyn - (Waiting for Hands On DBP Programming Vol. 1)
"It's better to wish down here you were up, then to wish up there you were down."
SirFire
19
Years of Service
User Offline
Joined: 4th Apr 2005
Location: North America
Posted: 10th Feb 2006 13:49 Edited at: 10th Feb 2006 13:56
A box is just a rectangle. A rectangle has 90 degree angles and perpindicular sides. So the first set of coordinates is the opposite corner of the second set. When drawing a box you do technically need 4 sets of coordinates, but 2 sets of coordinates will always follow a pattern derived from the the two main sets.
For example, 0,0,10,10 would be:

(0,0),(10,10)
If you've ever used qbasic you would recognize that this is very similar to LINE (0,0)-(10,10),B where the B tells the interpreter that instead of making a straight line, you want to make a box.

If you had to specify 4 points to make the box, you would end up with 0,0;10,0;10,10;0,10 but since you know it's a box, you can rule out the 2nd and 4th set, b/c the compiler will know to derive the missing coordinates from the sets given.

Attachments

Login to view attachments
UFO
19
Years of Service
User Offline
Joined: 11th Oct 2005
Location:
Posted: 10th Feb 2006 20:29
Yes, the first set of coordinates is the top left corner of the box, and the second set are the bottom right coordinates.

IF you want an unfilled box, use (or make) a function like this:



And call it like this:




Hippopotomonstrosesquippedaliophobia-Fear of long words
David iz cool
19
Years of Service
User Offline
Joined: 21st Sep 2005
Location: somewhere lol :P
Posted: 10th Feb 2006 23:11
i think the triangle command is confusing!

MAKE OBJECT TRIANGLE Object Number, X1, Y1, Z1, X2, Y2, Z2,
X3, Y3, Z3


??
Image All
18
Years of Service
User Offline
Joined: 30th Dec 2005
Location: Home
Posted: 11th Feb 2006 00:22


Basically the X1,Y1,Z1 coords are the point in space where the first vertex should be, X2,Y2,Z2 where the second should be, and X3,Y3,Z3 where the third and final vertex should be.

Yskonyn
21
Years of Service
User Offline
Joined: 19th Dec 2002
Location: Netherlands
Posted: 11th Feb 2006 02:31
Now this makes sense!
Thanks for all the feedback.


Yskonyn - (Waiting for Hands On DBP Programming Vol. 1)
"It's better to wish down here you were up, then to wish up there you were down."

Login to post a reply

Server time is: 2024-11-27 06:35:11
Your offset time is: 2024-11-27 06:35:11