
-----------------------------------
Infinit1
Sat Dec 17, 2011 11:17 pm

Graphics?
-----------------------------------
hey, i read through the guide http://compsci.ca/v3/viewtopic.php?t=376 but i still have some questions

1. Suppose I'm drawing a triangle, how would i know where the points (x,y) should be ?
2. suppose i want to put the triangle in a circle as eyes ( to make a smiley face), how would i know what co-ordinates shoul be used?

thx

-----------------------------------
Insectoid
Sat Dec 17, 2011 11:27 pm

RE:Graphics?
-----------------------------------
1. That's up to you. Pick a corner of the triangle, or the center. You should be using math to figure out the other coordinates. If you're using Draw.Polygon(), read the documentation.

2. How would you do this on paper, with math?

-----------------------------------
Infinit1
Sat Dec 17, 2011 11:47 pm

Re: Graphics?
-----------------------------------
...So, you're supposed to draw it on a graph paper and figur out the co-ordinates?

-----------------------------------
Insectoid
Sun Dec 18, 2011 12:20 am

RE:Graphics?
-----------------------------------
Figure out a formula to translate the circle's coordinates into the triangle's coordinates.

So yes, draw it on graph paper and figure out the coordinates. Just because you have a computer, doesn't mean paper is obsolete. I draw lots of diagrams and stuff all the time.

-----------------------------------
chipanpriest
Sun Dec 18, 2011 4:43 pm

Re: RE:Graphics?
-----------------------------------
If you're using Draw.Polygon(), read the documentation.

Where would I find this documentation?

-----------------------------------
Tony
Sun Dec 18, 2011 4:48 pm

RE:Graphics?
-----------------------------------
Turing docs -- [tdoc]Draw.Polygon[/tdoc]

-----------------------------------
chipanpriest
Sun Dec 18, 2011 5:30 pm

RE:Graphics?
-----------------------------------
thanks :D

-----------------------------------
Infinit1
Sun Dec 18, 2011 11:45 pm

RE:Graphics?
-----------------------------------
:( Sorry, but I'm still really confused about this. Even if i draw this on a graph paper and suppose I'm trying to make a circle, wont i have 4 points?   (top,bottom,left,right) ..

Also, I looked at the ways other people drew a circle

/turing

Draw.FillOval (maxx div 2, maxy div 2, 175, 175, yellow) 

/turing

How do they get that?

-----------------------------------
Tony
Mon Dec 19, 2011 12:12 am

RE:Graphics?
-----------------------------------
I suspect that we are talking about different things here.

An oval doesn't have 4 points, it has an "infinite" number of points, all a certain length from the center. In Turing this is described by 2 points (x,y) for the center location, and then two radii (vertical and horizontal. For a circle's radius, the two are the same value.).

See documentation for every Draw function to figure out what parameters do what. E.g. roughly 2~3 cm, but this depends on the monitor. It might help to draw a grid in the background for reference, and then turn it off in the final version of your project.

-----------------------------------
Infinit1
Mon Dec 19, 2011 11:31 am

RE:Graphics?
-----------------------------------
:) thx, i'm getting everything except what this mean's      "maxx div 2, maxy div 2"


How would I make a grid in the background though?

-----------------------------------
Insectoid
Mon Dec 19, 2011 11:42 am

RE:Graphics?
-----------------------------------
maxx div 2 is the maximum X value, divided by 2. In case it isn't obvious, that's the middle of the screen.

A grid is just a lot of lines. I'm sure you can figure it out.

-----------------------------------
Infinit1
Mon Dec 19, 2011 11:47 am

RE:Graphics?
-----------------------------------
oh.. mmk, i get that part now.

lol... I was hoping there would be a code for making the grid on the screen with the (x,y) values so i would know where the points should be

-----------------------------------
Insectoid
Mon Dec 19, 2011 11:49 am

RE:Graphics?
-----------------------------------
Better stop hoping for things. Most of the time they don't exist.

-----------------------------------
Tony
Mon Dec 19, 2011 12:13 pm

RE:Graphics?
-----------------------------------
an appropriate analogy here is that "programming is like LEGO", you can hope to find that one single piece that's a car, but nope, instead you'll get a box full of small pieces that can be assembled into any vehicle, including a car. Sure, you'd have to build it, but the advantage is that you can also build anything else too.
