www.jpct.net

jPCT - a 3d engine for Java => Support => Topic started by: kkl on February 05, 2013, 04:48:18 pm

Title: FrameBuffer resize
Post by: kkl on February 05, 2013, 04:48:18 pm
Hi I'm trying to resize the framebuffer from (800, 600) to (360, 600), but any object located outside of (360, 600) bound is clipped. Is it possible to resize the framebuffer while objects are still displayed beyond the resized bound?
Title: Re: FrameBuffer resize
Post by: EgonOlsen on February 05, 2013, 05:40:26 pm
 ??? I don't get it...you want to resize it but you also want to render objects outside of the resized buffer? I don't understand....
Title: Re: FrameBuffer resize
Post by: kkl on February 06, 2013, 08:10:52 am
Yea. The reason I'm doing that is to simulate android live wallpaper in pc so that object's scale factor and location stays the same in both platforms for easier development. The resized buffer represents the device screen while outside of boundary represents the entire live wallpaper. I tried simulating it by changing camera frustum, but I'm not sure how. Perhaps I'm not doing right? Or is there any alternative? Thanks.
Title: Re: FrameBuffer resize
Post by: EgonOlsen on February 06, 2013, 08:38:30 am
I still don't get it...maybe a drawing might help.
Title: Re: FrameBuffer resize
Post by: kkl on February 06, 2013, 09:56:31 am
I tried to upload some pics, but it doesn't hav the attachment option to upload in the new forum. ;( There is "Choose file" option in jpct android forum though.
Title: Re: FrameBuffer resize
Post by: kkl on February 06, 2013, 01:27:43 pm
I posted the drawings in JPCT-android forum anyway~

(http://www.jpct.net/forum2/index.php?action=dlattach;topic=3188.0;attach=472;image)


(http://www.jpct.net/forum2/index.php?action=dlattach;topic=3188.0;attach=474;image)

The first image is the one I would like achieve while the second image is the one without framebuffer resizing.
Title: Re: FrameBuffer resize
Post by: EgonOlsen on February 06, 2013, 08:57:07 pm
I see...what's wrong with calling buffer.resize(360,600); ? It's not meant to be used for that, but it actually does what i think you want. It limits the viewport to (0,0)-(360,600) and adjusts yFov accordingly.

BTW: I've checked board permissions...the old board (once imported from phpBB) seemed to have different permissions than the new ones (which were all set to "default"). I've set them all to "default" now. Maybe that fixes the problem with the image upload.
Title: Re: FrameBuffer resize
Post by: kkl on February 07, 2013, 04:25:59 pm
Yea. I guess I'm using the wrong way to do it. Any good suggestion for that case? Perhaps changing the viewport and adjust yFov manually?

p/s: The fix works. Now I see the "Choose file" option.
Title: Re: FrameBuffer resize
Post by: EgonOlsen on February 08, 2013, 10:16:48 am
By default yFov adjust automatically to ensure that it fits the xFov without distorting the rendered objects at the given resolution. It's the same on Android, so i'm still failing to see the problem... ???
Title: Re: FrameBuffer resize
Post by: kkl on February 11, 2013, 02:51:16 pm
Well~ It's not really a problem though... I think it works perfectly... Just that if I could adjust manually for viewport, it would be easier for me to develop android app in pc (like game engine). It's ok.. I'll just use whatever available.. Thanx alot ;)