#74156 - kmr - Thu Mar 02, 2006 10:33 pm
Hi, great forum :)
I would like to use openGL to draw 3D on both screens, preferably using a single viewport of 256x384; is it possible, and what would be the best way to go about it?
Thanks much.
#74158 - tepples - Thu Mar 02, 2006 10:44 pm
You don't want to use a single viewport of 256x384 pixels. There's a big gap between the screens, and they're normally oriented at an angle so that both screens directly face the player's eyes. You want to draw the scene, pitch the camera down by 19 degrees, and then draw the scene again, using capture to retain the last frame.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.
#74160 - kmr - Thu Mar 02, 2006 11:05 pm
Thanks for answering :)
Good point, but I'm using a top view, and changing the camera angle is not really what I want. So again, is it possible to do this?
#74161 - tepples - Thu Mar 02, 2006 11:08 pm
The Nintendo DS hardware does not allow for splitting one GL scene across both screens. They have to be rendered separately.
But from a game design perspective, how would you account for things split across screens?
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.
#74163 - Dark Knight ez - Thu Mar 02, 2006 11:23 pm
I was thinking of doing the same thing, but dropped the idea because it wouldn't add anything, and would just confuse with a big gap in between. How to use both screens needs to be thought about thoroughly.
Maybe a stupid question, but how did you come up with 19 degrees, Tepples?
#74166 - kmr - Thu Mar 02, 2006 11:51 pm
Yes, it is quite a design problem indeed. I was thinking of something along the lines of sonic rush, where only one screen is active at a time, while the other acts as a look ahead of some sorts. Except never switch screens, just keep the bottom one as the active one. You're right that space in between is trouble, now that I look at it, they do take a viewpoint that is a little higher on the top screen. I usually think it's a shame to only really use one screen out of two, that's why I was going down that path.
#74167 - tepples - Fri Mar 03, 2006 12:06 am
Dark Knight ez wrote: |
Maybe a stupid question, but how did you come up with 19 degrees, Tepples? |
Ruler + trig = ghetto protractor.
kmr: You could draw the playfield on the top and the 2D map on the bottom like Super Mario 64 DS and Mario Kart DS do, or vice versa like Kirby: Canvas Curse does.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.
#74171 - kmr - Fri Mar 03, 2006 12:33 am
I know, that was the other option :) I'm trying to go for the least explored path here, see if it works.
#74183 - Extreme Coder - Fri Mar 03, 2006 7:14 am
and is it possible to still move a camera in glOrtho:P?
and is it possible to capture the screen even if you didn't glPopMatrix?
#74190 - Stonebone - Fri Mar 03, 2006 10:22 am
During the flyby in Mario Kart DS both screens are used for 3d, but it's kind of useless acually because you can't see much on the lower screen.
#74193 - ninogenio - Fri Mar 03, 2006 12:21 pm
tepples wrote:
Quote: |
You don't want to use a single viewport of 256x384 pixels. There's a big gap between the screens |
why not ive done this in 2d with a tilemapper engine and accounted for the gap in the middle ie sonic rush style.
in saying that it will be hard though you actually want to treat the two screens sepratly with there own engines takeing care of things and then alline the two engines to gether to work in hamony its not a very pretty thing to code but could definitly be done with frame capture.[/quote]
#74270 - sajiimori - Fri Mar 03, 2006 11:00 pm
ninogenio,
You have to do two separate renders regardless of whether you account for the gap.
#74283 - ninogenio - Sat Mar 04, 2006 2:11 am
i know all about the capturing hardware and all i was saying was although messy to code and would require two engines running parrally at reduced fps it could be done and actually looks quite nice.
#74287 - sajiimori - Sat Mar 04, 2006 2:42 am
If you write good code, it won't be messy. :)
#74358 - Extreme Coder - Sat Mar 04, 2006 7:35 pm
niogenio, it doesnt have to be slow, just render the top screen, copy it to the top screen, then render the bottom screen;)
#74435 - ninogenio - Sun Mar 05, 2006 4:50 am
30fps!
#74447 - sajiimori - Sun Mar 05, 2006 6:55 am
Rendering is consistently our top CPU user, so rendering twice would be very costly.
#74500 - Extreme Coder - Sun Mar 05, 2006 2:04 pm
I actually ment to render both in the same frame, first render top screen , copy it over there, then render bottom screen.
But it seems that that the 3d scene gets drawn when u flush it, and you can only flush once in a frame, so :(
#78438 - kmr - Fri Apr 07, 2006 7:38 am
Hum, so it's not possible to render to a screen, then call lcpSwap(), and render to the other. I get flickering when I do this, which possibly means the other screen is just rendered black (or both images are rendered to the same screen)?
Anyone has a link to sample code to do this the right way (using display capture)? edit: nm, found it (http://forum.gbadev.org/viewtopic.php?t=7958), but can't get it to work (it shows both models on the same screen), but maybe I can figure it out.
#78466 - ecurtz - Fri Apr 07, 2006 2:58 pm
kmr wrote: |
(http://forum.gbadev.org/viewtopic.php?t=7958), but can't get it to work (it shows both models on the same screen) |
Try the other link in that message. There are two demos, one using both screens and one rendering to the same screen twice (for higher polygon counts).