Re: M3G: viewport after bindTarget()
Claus Höfele <[email protected]>
| Newsgroups | gmane.comp.java.sun.kvm |
|---|---|
| Message-ID | <[email protected]> |
The viewport values returned by Graphics3D.getViewportX/Y/Width/Height() are wrong on the WTK (2.5.1). These methods simply return the last values you set with setViewport() or (0, 0, 0, 0) by default. However, even though the values say the viewport is 0 by default, the actual viewport is set to a reasonable size (at least when using bindTarget(Graphics); I assume this holds true for bindTarget(Image2D) as well). It's still a good idea to set the viewport manually to avoid funny clip rects. Regards, Claus -- Mobile 3D Graphics: Learning 3D Graphics with the Java Micro Edition http://www.claushoefele.com/m3g/ ISBN: 1598632922 Order from Amazon: http://www.amazon.com/gp/product/1598632922 Barnes & Noble: http://search.barnesandnoble.com/booksearch/isbnInquiry.asp?EAN=9781598632927 On 8/27/07, BJörn Lindqvist <[email protected]> wrote: > Hello all, > > If I interpret the M3G spec correctly, the viewport should after a > call to g3d.bindTarget(image), where image is an Image2D object, be > equal to (0,0)-(image.width,image.height). The specification is kind > of vague but says the following: > > "The state of this Graphics3D after calling this method [bindTarget] > will be as follows: > > viewport : covering the target clipping rectangle" > > and "For Image2D targets, the clipping rectangle comprises all pixels > in the target image." > > Yet, on all devices I have tried (including Sun WTK2.5-Beta2), the > viewport is set to (0,0)-(0,0) directly after the call to viewport. So > can someone please explain what is wrong? > > -- > mvh Björn > > =========================================================================== > To unsubscribe, send email to [email protected] and include in the body > of the message "signoff KVM-INTEREST". For general help, send email to > [email protected] and include in the body of the message "help". > =========================================================================== To unsubscribe, send email to [email protected] and include in the body of the message "signoff KVM-INTEREST". For general help, send email to [email protected] and include in the body of the message "help".