Strict Standards: Non-static method utf_normalizer::nfc() should not be called statically in /www/htdocs/w006661d/anddev/includes/utf/utf_tools.php on line 1781
[phpBB Debug] PHP Notice: in file /includes/session.php on line 1007: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/session.php on line 1007: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/session.php on line 1007: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)

Strict Standards: Non-static method utf_normalizer::nfc() should not be called statically in /www/htdocs/w006661d/anddev/includes/utf/utf_tools.php on line 1781
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4362: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4364: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4365: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4366: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
anddev.org • View topic - Where am I clicking?

Where am I clicking?

Problems with Canvas, OpenGL, etc...

Where am I clicking?

Postby rHalf » Thu Sep 09, 2010 2:50 am

Please can someone explain in layman's terms how this is determined. What is the algorithm used? I see people mention ray tracing. If thats applicable here can someone give a dumbed down explanation of it?

My situation is this. I'm looking down at a board with pieces on it. I want to place the next piece by using the touch input. I get the x, y coordinated from the touch input and I have my screen width and height.

I use a standard declaration for my perspective:
Code: Select all
float ratio = (float) width / height;
GLU.gluPerspective(gl, 45.0f, ratio, 1, 100f);

If it helps assume we are using a MotoDroid resolution [480 x 854]

Before drawing anything I pull my camera back by 30.0f
Code: Select all
gl.glTranslatef(0, 0, -30.0f);


Are there other numbers I need to make the calculation?

So, if I click 0,0 on my screen and my gameboard is 30f deep into the screen how do I get the x,y on my board?

Thanks so much
rHalf
Junior Developer
Junior Developer
 
Posts: 16
Joined: Sun Dec 20, 2009 1:54 am

Top

Return to Android 2D/3D Graphics - OpenGL Problems

Who is online

Users browsing this forum: No registered users and 3 guests