Page 1 of 1
Sprites (not 3DSprites)& 3D(GL)at the same time,How?(SOLVE)
Posted: Sat Aug 22, 2009 4:06 pm
by WhiteSkull
Hi again, i can not put on screen, Sprites and Graphics3D at the same time... I did not find any examples or thread in this forum that references this ...
However, I can put a BG with a 3D object, but what I'm looking for is not really what I want to put a marker of life ... and do not want to use the other screen
Help Help
Re: Sprites (not 3DSprites) & 3D (GL) at the same time, How?
Posted: Sun Aug 23, 2009 7:03 pm
by WhiteSkull
"Thank you all for your answers" ... is not possible to use Sprites and 3D at once on the same screen... Only thing...I solved using a QUAD with a bitmap, and I was fine, but after fight with all kinds of formulas
Re: Sprites (not 3DSprites)& 3D(GL)at the same time,How?(SOLVE)
Posted: Tue Aug 25, 2009 10:06 am
by Discostew
Sprites and 3D together? I don't see why not, since it would work in the same way as sprites and BGs. The way 3D is displayed is via BG0 as a layer. While I can't supply an example, you have the option of setting each VRAM bank to what you want, but you can't "mix" things like textures and sprites to the same bank. libnds's texture manager is set so that if you were to set any of the main banks as anything other than textures, it will skip those banks when dealing with texture loading. Also, libnds uses VRAM_E for texture palettes automatically, but you can use VRAM_F or VRAM_G for sprite palettes. I'm not sure if they can both be set for a combined 32KB under the same type like the main banks can.
It should be possible to use the individual 3D and sprite examples to form what you are looking for.
Re: Sprites (not 3DSprites)& 3D(GL)at the same time,How?(SOLVE)
Posted: Tue Aug 25, 2009 6:52 pm
by WhiteSkull
Yes! The theory is very nice ...Although it may well be, so that comment, i made it, put a "background" with "3D"...using "PAlib" combined with "libnds"... but anyway, thanks ... I got it with a "QUAD" and a texture...
Discostew wrote:It should be possible to use the individual 3D and sprite examples to form what you are looking for.
That means one thing ...
Do not know or have not done it.
If you like, you can try and then tell me, lucky
Re: Sprites (not 3DSprites)& 3D(GL)at the same time,How?(SOLVE)
Posted: Tue Aug 25, 2009 8:59 pm
by Discostew
PAlib? Hmmm. I don't know the situation with that, because I've never used it, nor do I know how it works. libnds is a different circumstance for me because I reference myself with the source, and either work around it, or don't use a section of it so I can have better control.
Re: Sprites (not 3DSprites)& 3D(GL)at the same time,How?(SOLVE)
Posted: Wed Aug 26, 2009 9:15 am
by WhiteSkull
I used "PALib" and "libnds", to use a BG in a 3D scene, because "PAlib simplifies some things made with" libnds. Sure you can do well with "libnds", because this is the engine of "PAlib"...
I also had problems with "Stylus" not working well, and finally i chose to use "touchRead" think i should do everything with "libnds" to avoid problems... I don't know
Re: Sprites (not 3DSprites)& 3D(GL)at the same time,How?(SOLVE)
Posted: Wed Aug 26, 2009 10:02 am
by StevenH
WhiteSkull wrote:think i should do everything with "libnds" to avoid problems...
As is often said on gaming forums: Quoted for truth.
or just more simply QFT.
if your using palib, then your more than likely using an old version of devkitARM / libnds - which means your going to be missing out on a few of the more higher level API's that libnds has now.
Oh and you don't need to put quote marks around libnds, devkitARM, etc. as for PAlib I prefer the term **lib, as I always feel like I'm swearing when saying it for some reason...
Re: Sprites (not 3DSprites)& 3D(GL)at the same time,How?(SOLVE)
Posted: Fri Aug 28, 2009 1:04 pm
by WhiteSkull
Although at first i had used mathematical formulas, I could not put what I wanted:
Code: Select all
...
...
// get angle in radians
angleH=atan2(camera.lookat.z-camera.z,camera.lookat.x -camera.x);
angleV=atan2(camera.lookat.z-camera.z,camera.lookat.y -camera.y);
quad.x=radio*cos(angleH);
quad.y=radio*cos(angleV);
// I dont know?¿
//quad.z=sin(angleH); // work in horizontal
//quad.z=sin(angleV); // work in vertical
...
...
So I looked for a solution to this, and a friend,
Ferran, who knows the 3D world, showed me a simple solution:
Code: Select all
...
...
while(1)
{
// render scene
// camera
gluLookAt( pos.x, pos.y, pos.z, vista.x, vista.y, vista.z, 0.0, 1.0, 0.0);
// reset the MODELVIEW matrix
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
// the QUAD in question
glFlush(0);
}
...
and is exactly what I wanted, thank
Ferran...