RE

by Ben (no login)

I think it would look much better with vanishing points. I'm not sure what you mean by x,y,z,p,q. But when you are doing 2 D you got two numbers that show direction.

Like:

line (0,0)-(x,y)

But in 3 D you would need another one which I assume you mean Z which should look like digging in to the monitor. It would be:

line (0,0,0)-(x,y,z)

But that can't be done so it is used something like maybe if you have a triangle X,Y,V: You would then draw the same triangle only exact opposite to the triangle of XYV, and the 3rd line Z would be going into the opposite corner of the triangle to show perspective. But then the length of Z going into the opposite angle would have to be divided by something to show how far away the eye is.


" I suggest you take the eye to be at (0, 0, 0) and the centre of the screen to be (0, 0). Draw a picture of this looking from above, and looking from the side, identify where x, y, z, p and q are on the diagrams, and try to find p and q in terms of x, y and z (this requires similar triangles). "

Well, I didn't understand any of that, but I tried this:

SCREEN 9, , 1, 0

a1 = 320
a2 = 50

b1 = 280
b2 = 100

c1 = 360
c2 = 100

d1 = 320
d2 = 150

z = 0

DO
LINE (0, 0)-(640, 350), 0, BF

LINE (a1, a2)-(b1, b2)
LINE (a1, a2)-(c1, c2)
LINE (c1, c2)-(d1, d2)
LINE (b1, b2)-(d1, d2)

LINE (a1, a2 + z)-(b1, b2 + z)
LINE (a1, a2 + z)-(c1, c2 + z)
LINE (c1, c2 + z)-(d1, d2 + z)
LINE (b1, b2 + z)-(d1, d2 + z)

LINE (a1, a2)-(a1, a2 + z)
LINE (b1, b2)-(b1, b2 + z)
LINE (d1, d2)-(d1, d2 + z)
LINE (c1, c2)-(c1, c2 + z)

a2 = a2 + 1
d2 = d2 - 1

i = i + 1
z = z + 1
'I tried something like this to have it rotate:
'z = SIN(i / 10) * 10 'But that didn't work sadly
'why? I don't know. It should be adding negative numbers
'when the sine is reaching the bottom.

IF i = 52 THEN EXIT DO

SLEEP 1
PCOPY 1, 0
WAIT &H3DA, 8, 8
WAIT &H3DA, 8
LOOP







Anyways, must I learn the analytic geometry if I just want to make simple programs that resemble something of 3d, but maybe not 100% accurate?

They don't teach any useful math at school and they aren't any time soon so I don't know where to start learning the things I would need to understand geometry. I tried learning the trigonmentry, I understand the functions and stuff, but I can't solve the tringomentric equations. And I don't what this type of stuff means:

sin^2 (x) <<????

Ben


P.S. I've been reading about the PHP and I think I understand the basic structure (I know for/while loops, if/else arrays variables etc) but I don't know any of the built in fucntions that do stuff. I also don;t understand things like:

$variable = new variabletype();

I say they are the same as types, but Galleon says they aren't the same as types so I'm confused. I also don;t know what this operator does: =>.

Anyways, where can I find the source code so I can learn this by example?

Posted on Mar 13, 2009, 5:58 PM

Respond to this message   

Return to Index


Response TitleAuthor and Date
Briefly on Mar 13, 6:20 PM
In answer to your other questions on Mar 14, 3:05 AM