|
Author |
Topic: shape methods (Read 315 times) |
|
benelek
|
shape methods
« on: Mar 9th, 2003, 1:04am » |
|
wouldnt mind being able to do this: Code: beginShape(LINE_LOOP); vertex(0,0); vertex(80,0); rotate(radians(30)); vertex(80,0); rotate(radians(30)); vertex(80,0); endShape(); |
| -bnlk
|
|
|
|
fry
|
Re: shape methods
« Reply #1 on: Mar 25th, 2003, 4:23pm » |
|
yeouch. not even opengl lets you do this though you're right, it is nice in your example. for something like that in the meantime, you can also just use cos/sin. Code:beginShape(LINE_LOOP); vertex(0, 0); vertex(80*cos(radians(0)), 80*sin(radians(0))); vertex(80*cos(radians(30)), 80*sin(radians(30))); vertex(80*cos(radians(60)), 80*sin(radians(60))); endShape(); |
| or something like that..
|
|
|
|
benelek
|
Re: shape methods
« Reply #2 on: Mar 26th, 2003, 1:12pm » |
|
actually, ive been wondering about that for a while - which would be faster, generating the x,y,z coordinates of something to draw (using cos/sin/tan etc), or using the rotate methods in conjunction with push/pop to move to those points and then draw?
|
|
|
|
benelek
|
Re: shape methods
« Reply #3 on: Mar 26th, 2003, 1:13pm » |
|
uh, perhaps i should rephrase - which would be more efficient?
|
|
|
|
fry
|
Re: shape methods
« Reply #4 on: Mar 26th, 2003, 1:36pm » |
|
at least for individual points, doing sin/cos yourself is more efficient. rotate() involves more math internally. plus sin/cos are fun! for groups of points/shapes it's better to use rotate() and company.
|
|
|
|
|