View previous topic :: View next topic |
Author |
Message |
snake5 Indago dalībnieks
Joined: 27 Jun 2007 Posts: 2590
|
Posted: Sun Sep 16, 2007 5:17 pm Post subject: aatrais jautaajums - 2d lookat |
|
ja es zinu ekraana izmeerus (width/height), kaa tad lai es apreekinu "x" prieksh lookat funkcijas:
vec_to = {width/2,height/2,0}
vec_from = {width/2,height/2,x}
vec_up = {0,-1,0}
kaa? _________________ "There are two choices here: "looks good" and "realism"." -- Paul Nettle |
|
Back to top |
|
|
snake5 Indago dalībnieks
Joined: 27 Jun 2007 Posts: 2590
|
Posted: Sun Sep 16, 2007 8:00 pm Post subject: |
|
nu plzz paliidziet, nezinu, kaa googlee peec shitaa mekleet! nezinu, kaa tiek reekinaats fov/aspect ratio, u.t.t., tas man ljoti paliidzeetu!!! _________________ "There are two choices here: "looks good" and "realism"." -- Paul Nettle |
|
Back to top |
|
|
bubu Indago Uzvarētājs
Joined: 23 Mar 2004 Posts: 3223 Location: Riga
|
Posted: Sun Sep 16, 2007 10:03 pm Post subject: |
|
Kāpēc tu gribi lietot kautkādu lookat 2d projekcijai?
Vai tad nepietiek vienkārši glTranslatef(width, height, 0); (ja ir uzstādīta ortogonāla projekcija) ?
Un Modelview matricai nekāds fov nav vajadzīgs. |
|
Back to top |
|
|
snake5 Indago dalībnieks
Joined: 27 Jun 2007 Posts: 2590
|
Posted: Mon Sep 17, 2007 11:30 am Post subject: |
|
1. es lietoju d3d, kaa vienmeer
2. man vajag panaakt, lai, ja es piemeeram ziimeetu 4stuuri (x1-0,x2-320,y1-240,y2-480), tad vinjsh arii paraadiitos preciizi kreisajaa apaksheejaa ekraana daljaa ar augsheejo labo stuuri uz centra!
nu kjipa lai pa taisno ziimeejaas screenspace koordinaatees (uz 640x480 tas buutu - augshaa pa kreisi - 0,0;lejaa pa labi - 640x480)!!! _________________ "There are two choices here: "looks good" and "realism"." -- Paul Nettle |
|
Back to top |
|
|
bubu Indago Uzvarētājs
Joined: 23 Mar 2004 Posts: 3223 Location: Riga
|
Posted: Mon Sep 17, 2007 3:51 pm Post subject: |
|
snake5 wrote: | 1. es lietoju d3d, kaa vienmeer |
Tas nemaina lietas būtību. d3d un ogl strādā ar vienām un tām pašām matricām.
Maini vien to pašu modelview matricu ar parastu translācijas transformāciju ortogonālā projekcijā un viss notiksies. |
|
Back to top |
|
|
snake5 Indago dalībnieks
Joined: 27 Jun 2007 Posts: 2590
|
Posted: Mon Sep 17, 2007 4:57 pm Post subject: |
|
ok, meeginaashu! _________________ "There are two choices here: "looks good" and "realism"." -- Paul Nettle |
|
Back to top |
|
|
snake5 Indago dalībnieks
Joined: 27 Jun 2007 Posts: 2590
|
Posted: Mon Sep 17, 2007 5:13 pm Post subject: |
|
ew toc viss aizgaaja kaa naakas! paldies! _________________ "There are two choices here: "looks good" and "realism"." -- Paul Nettle |
|
Back to top |
|
|
|