I just draw all my 3d stuff using a projection matrix, and then I just
change the projection matrix and clear the depth buffer and draw all
the 2d stuff.

As for coordinates, in opengl you set them whatever you want to be. I
use floats, you can use ints, I use -1 to 1, you can use 1000 to
10,000 if you want. Study the projection matrix more if you want to
know how to switch between 2d and 3d.

Adam



On Oct 28, 7:40 pm, Matt Quigley <matthew.quig...@gmail.com> wrote:
> I'm making a 2D game, with sprites drawn using the glDrawTexfOES()
> method.  I'm wondering if there are ways to draw things like lines and
> squares along side this.
>
> Now, I know that technically there's nothing stopping me from drawing
> 3D cubes and such.  But, you see, glDrawTexfOES draws using pixel
> coordinates, i.e. draw texture at 30,30.  What I'd like is a similar
> approach to boxes and lines, using pixel coordinates, i.e. draw line
> from (5,5) to (10,10).  Is this possible?
>
> I don't want to simulate 3D coordinates because it would be very hard
> to try to get the camera and perspective in such a perfect way where I
> could say draw cube from (5,5,0) to (10,10,0), as well as from
> (300,300,0) to (310, 310, 0), with no perspective warping in the
> different corners.  (Also, as a backup plan I can always create my
> line and box effects with sprite textures as well, but I thought I'd
> ask)

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to