Monday, May 10, 2010

[android-developers] Re: draw a 2d marker on a openGL scene

I couldn't find it either, hrmm Anyway it's like this:

gl.glMatrixMode(GL10.GL_PROJECTION);
gl.glPushMatrix();
gl.glLoadIdentity();
GLU.gluOrtho2D(gl, 0, viewportWidth, viewportHeight, 0);
gl.glMatrixMode(GL10.GL_MODELVIEW);

// draw your quad in 2d here - coordinate system is top left = 0,0 to
bottom right = width,height

gl.glMatrixMode(GL10.GL_PROJECTION);
gl.glPopMatrix();
gl.glMatrixMode(GL10.GL_MODELVIEW);


On May 10, 5:32 am, Paolo <brand...@gmail.com> wrote:
> I searched for that, but i did't find anything... Could you link it,
> please?
>
> On 4 Mag, 17:48, Robert Green <rbgrn....@gmail.com> wrote:
>
>
>
>
>
> > Paolo,
>
> > If you want to do it the canvas-style,
>
> > Just flip the projection to orthographic and draw a 2D quad.  I have
> > posted the code for that more than once on here so if you do a search
> > you'll probably find it somewhere.
>
> > On May 4, 5:02 am, Paolo <brand...@gmail.com> wrote:
>
> > > Hi robert, thanks for your answer.
> > > It could be a possible way, but i i think is too much for my
> > > objective. In my case the camera is static, instead it is the grid
> > > that moves around me.
>
> > > I have only to put some static object over the grid. I say object, but
> > > is more correct say small picture. Consider that I'm developing an
> > > Augmented Reality App.
>
> > > I hoped that was possible to do that, using canvas on the opengl grid,
> > > but maybe is impossible.
>
> > > On 3 Mag, 21:10, Robert Green <rbgrn....@gmail.com> wrote:
>
> > > > If you want the 2D objects to have depth, you'll want to use
> > > > billboarded quads.  You may want to look around to find a better
> > > > implementation but here's a tutorial -http://www.lighthouse3d.com/opengl/billboarding/
>
> > > > On May 3, 8:47 am, Paolo <brand...@gmail.com> wrote:
>
> > > > > Hi guys!
>
> > > > > I've a problem and I'm not able to solve at the moment.
>
> > > > > I have realized a grid with openGL on a GLSurfaceview. This grid
> > > > > rotates at 360° on all the aces using the orientation sensors.
>
> > > > > Now I'd like to put over it some markers at specified coordinates,
> > > > > such as 2D objects, as if they were attached to the grid, because they
> > > > > have to rotate together to the grid.
>
> > > > > How how I can make it?
>
> > > > > Thanks.
>
> > > > > Paolo
>
> > > > > --
> > > > > 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+unsubscribe@googlegroups.com
> > > > > For more options, visit this group athttp://groups.google.com/group/android-developers?hl=en
>
> > > > --
> > > > 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+unsubscribe@googlegroups.com
> > > > For more options, visit this group athttp://groups.google.com/group/android-developers?hl=en
>
> > > --
> > > 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+unsubscribe@googlegroups.com
> > > For more options, visit this group athttp://groups.google.com/group/android-developers?hl=en
>
> > --
> > 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+unsubscribe@googlegroups.com
> > For more options, visit this group athttp://groups.google.com/group/android-developers?hl=en
>
> --
> 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+unsubscribe@googlegroups.com
> For more options, visit this group athttp://groups.google.com/group/android-developers?hl=en

--
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+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

No comments:

Post a Comment