Jump to content

  • Log In with Google      Sign In   
  • Create Account


N1ghtDr34m3r

Member Since 19 Aug 2012
Offline Last Active May 21 2013 03:10 PM
-----

Posts I've Made

In Topic: glAlphaFunc in gl20 ? or How do I enable alpha in gl20 ?

05 November 2012 - 02:06 PM

Oh... I'm so a badass boy, I don't use gl20 with a shader. xD
Thank you very much. Now I know what I will google later. ;-)

"Thread.join()"
^^

In Topic: a few questions about using libgdx :)

11 September 2012 - 01:54 PM

Hey simondid.

1. The whole library uses OpenGL, but in difference to something else, you don't have to "learn" OpenGL, due to the fact, that you could use SpriteBatch & Textures and so on. So you don't have to explicity code some openGL.
(Maybe a little bit like glClear(GL10.GL_COLOR_BUFFER_BIT), but it's not so much.)

2. Yes and no. You can structure your code like you did in slick. But you have to implement it into the libGdx-Framework (like 'Game' if your main class extends from it).

3. When you use Screens it have a render method (where you can also update), show and hide methods ("what must be done, if the window is not in the foreground?" etc.), resume and stop methods, which you have to overwrite or just implement your own class into it.

4. I don't know any, but maybe some other users do. Posted Image

PS: Excuse me for my bad english. My english teacher can't really teach and I'm too lazy doing it in my free space... ^^

In Topic: Problem with width and height of quads

07 September 2012 - 01:56 PM

D3DXMATRIXA16 projection;
D3DXMatrixPerspectiveFovLH(&projection, D3DX_PI/4, (float)width / (float)height, 0.0f, 100.0f);
d3d9Device->SetTransform(D3DTS_PROJECTION,&projection);
Okay, so I have the same fov like in my Init(). Posted Image

Yeah, thanks for the tipp. Posted Image

EDIT:

I found the problem, namely that for the aspect I don't have to write
(float)(1280/720)
but
(1280.0f/720.0f)
. Posted Image

Now the quad fills the entire screen. Posted Image

Thank you for helping! Posted Image

In Topic: Problem with width and height of quads

07 September 2012 - 06:18 AM

Thank you very much. That is just what I needed to know! Posted Image

How do I calculate the vertically fov ? My Code is now:
float width = tan((D3DX_PI/4)/2)*(float)(1280/720)*(1.0f);
float height = tan((D3DX_PI/4)/2)*(1.0f);
// Set up vertex buffer
D3DVERTEX quad[4] = {
	   {D3DXVECTOR3(-width, -height, -1.0f), D3DXVECTOR2(0.0f, 1.0f)},
	   {D3DXVECTOR3(-width,  height, -1.0f), D3DXVECTOR2(0.0f, 0.0f)},
	   {D3DXVECTOR3( width, -height, -1.0f), D3DXVECTOR2(1.0f, 1.0f)},
	   {D3DXVECTOR3( width,  height, -1.0f), D3DXVECTOR2(1.0f, 0.0f)},
	  };
It has the same height as the screen, but the width is too small to cover the whole screen.

Posted Image

In Topic: Problem with width and height of quads

06 September 2012 - 02:08 PM

I didn't really need screen coordinate. But I need 3D coordinates, which I don't have. Posted Image
My example was a quad which should perfectly fits the screen.
My screens size is 1280x720 pixels.
The vertices of my quad are A(-1/-1/10), B(1/-1/10), C(1/1/10) and D(-1/1/10) (for point(x/y/z)).
But it's too big (~3 times as big as my screen), so, which numbers I have to choose for x/y/z to have my quad as 1280x720 pixel?

PARTNERS