[android-developers] Re: 2D over 3D

2008-12-03 Thread fcalzada

Yes this is what I've done with M3G, and i was about to implement this
startegy when i found a workaround using NumericSprite, LabelMarker
samples form the APIDemo.



On Dec 2, 8:11 pm, Robert Green [EMAIL PROTECTED] wrote:
 You can just do one square billboard positioned such that it is
 directly in front of the frustum.  The texture can be transparent and
 you just draw what you want to have show up.  That will be only 2
 additional polys for the2D.

 On Dec 2, 9:56 am, fcalzada [EMAIL PROTECTED] wrote:

  Yes i thought about it, but it's gonna take some3dresources... and
  my application is already quite heavy in vertices number

  On Dec 2, 3:51 pm, Robert Green [EMAIL PROTECTED] wrote:

   In desktop3Dstuff I've always just created billboards and drawn to
   the textures for them.  I'm sure this same technique would work.

   On Dec 2, 4:29 am, fcalzada [EMAIL PROTECTED] wrote:

Hi,

I'm having the same issue, I tried hard but without success.
Did you find a workaround ?

thanks

On Nov 20, 1:57 pm, petunio [EMAIL PROTECTED] wrote:

 Hi

 I am porting an application based on the sdk 3.0, and I am having
 countless problems...

 now, I am struggling trying to put2Dgraphics on top of a3Dscene...

 After a lot of headache, I managed to create a opengl context, which
 now works, but when I try to put2Dgraphics on top of it, this is
 what happens:

 public void drawFrame(GL10 gl)
 {
                 //view is a SurfaceView, and the value is not null !
                 mySurfaceHolder=view.getSurfaceHolder();

                 Canvas c=mySurfaceHolder.lockCanvas();

                 //this is where I wanted to place my2Ddrawing, but
 after the above line, this is
                 //what I got in the Log:
 //11-20 12:52:02.508: ERROR/SurfaceComposerClient(490): eLocked set
 when entering lock_layer(), //layer=1 (lcblk=0x410420a0),
 state=0020
 //11-20 12:52:02.598: ERROR/SurfaceHolder(490): Exception locking
 surface

                 mySurfaceHolder.unlockCanvasAndPost(c);

 }

 Any help would be very appreciated

 Thanks!


--~--~-~--~~~---~--~~
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
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: 2D over 3D

2008-12-02 Thread fcalzada

Hi,

I'm having the same issue, I tried hard but without success.
Did you find a workaround ?

thanks

On Nov 20, 1:57 pm, petunio [EMAIL PROTECTED] wrote:
 Hi

 I am porting an application based on the sdk 3.0, and I am having
 countless problems...

 now, I am struggling trying to put 2D graphics on top of a 3D scene...

 After a lot of headache, I managed to create a opengl context, which
 now works, but when I try to put 2D graphics on top of it, this is
 what happens:

 public void drawFrame(GL10 gl)
 {
                 //view is a SurfaceView, and the value is not null !
                 mySurfaceHolder=view.getSurfaceHolder();

                 Canvas c=mySurfaceHolder.lockCanvas();

                 //this is where I wanted to place my 2D drawing, but
 after the above line, this is
                 //what I got in the Log:
 //11-20 12:52:02.508: ERROR/SurfaceComposerClient(490): eLocked set
 when entering lock_layer(), //layer=1 (lcblk=0x410420a0),
 state=0020
 //11-20 12:52:02.598: ERROR/SurfaceHolder(490): Exception locking
 surface

                 mySurfaceHolder.unlockCanvasAndPost(c);

 }

 Any help would be very appreciated

 Thanks!
--~--~-~--~~~---~--~~
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
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: 2D over 3D

2008-12-02 Thread Robert Green

In desktop 3D stuff I've always just created billboards and drawn to
the textures for them.  I'm sure this same technique would work.

On Dec 2, 4:29 am, fcalzada [EMAIL PROTECTED] wrote:
 Hi,

 I'm having the same issue, I tried hard but without success.
 Did you find a workaround ?

 thanks

 On Nov 20, 1:57 pm, petunio [EMAIL PROTECTED] wrote:

  Hi

  I am porting an application based on the sdk 3.0, and I am having
  countless problems...

  now, I am struggling trying to put 2D graphics on top of a 3D scene...

  After a lot of headache, I managed to create a opengl context, which
  now works, but when I try to put 2D graphics on top of it, this is
  what happens:

  public void drawFrame(GL10 gl)
  {
                  //view is a SurfaceView, and the value is not null !
                  mySurfaceHolder=view.getSurfaceHolder();

                  Canvas c=mySurfaceHolder.lockCanvas();

                  //this is where I wanted to place my 2D drawing, but
  after the above line, this is
                  //what I got in the Log:
  //11-20 12:52:02.508: ERROR/SurfaceComposerClient(490): eLocked set
  when entering lock_layer(), //layer=1 (lcblk=0x410420a0),
  state=0020
  //11-20 12:52:02.598: ERROR/SurfaceHolder(490): Exception locking
  surface

                  mySurfaceHolder.unlockCanvasAndPost(c);

  }

  Any help would be very appreciated

  Thanks!


--~--~-~--~~~---~--~~
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
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: 2D over 3D

2008-12-02 Thread fcalzada

Yes i thought about it, but it's gonna take some 3d resources... and
my application is already quite heavy in vertices number


On Dec 2, 3:51 pm, Robert Green [EMAIL PROTECTED] wrote:
 In desktop 3D stuff I've always just created billboards and drawn to
 the textures for them.  I'm sure this same technique would work.

 On Dec 2, 4:29 am, fcalzada [EMAIL PROTECTED] wrote:

  Hi,

  I'm having the same issue, I tried hard but without success.
  Did you find a workaround ?

  thanks

  On Nov 20, 1:57 pm, petunio [EMAIL PROTECTED] wrote:

   Hi

   I am porting an application based on the sdk 3.0, and I am having
   countless problems...

   now, I am struggling trying to put 2D graphics on top of a 3D scene...

   After a lot of headache, I managed to create a opengl context, which
   now works, but when I try to put 2D graphics on top of it, this is
   what happens:

   public void drawFrame(GL10 gl)
   {
                   //view is a SurfaceView, and the value is not null !
                   mySurfaceHolder=view.getSurfaceHolder();

                   Canvas c=mySurfaceHolder.lockCanvas();

                   //this is where I wanted to place my 2D drawing, but
   after the above line, this is
                   //what I got in the Log:
   //11-20 12:52:02.508: ERROR/SurfaceComposerClient(490): eLocked set
   when entering lock_layer(), //layer=1 (lcblk=0x410420a0),
   state=0020
   //11-20 12:52:02.598: ERROR/SurfaceHolder(490): Exception locking
   surface

                   mySurfaceHolder.unlockCanvasAndPost(c);

   }

   Any help would be very appreciated

   Thanks!


--~--~-~--~~~---~--~~
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
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: 2D over 3D

2008-12-02 Thread Robert Green

You can just do one square billboard positioned such that it is
directly in front of the frustum.  The texture can be transparent and
you just draw what you want to have show up.  That will be only 2
additional polys for the 2D.

On Dec 2, 9:56 am, fcalzada [EMAIL PROTECTED] wrote:
 Yes i thought about it, but it's gonna take some 3d resources... and
 my application is already quite heavy in vertices number

 On Dec 2, 3:51 pm, Robert Green [EMAIL PROTECTED] wrote:

  In desktop 3D stuff I've always just created billboards and drawn to
  the textures for them.  I'm sure this same technique would work.

  On Dec 2, 4:29 am, fcalzada [EMAIL PROTECTED] wrote:

   Hi,

   I'm having the same issue, I tried hard but without success.
   Did you find a workaround ?

   thanks

   On Nov 20, 1:57 pm, petunio [EMAIL PROTECTED] wrote:

Hi

I am porting an application based on the sdk 3.0, and I am having
countless problems...

now, I am struggling trying to put 2D graphics on top of a 3D scene...

After a lot of headache, I managed to create a opengl context, which
now works, but when I try to put 2D graphics on top of it, this is
what happens:

public void drawFrame(GL10 gl)
{
                //view is a SurfaceView, and the value is not null !
                mySurfaceHolder=view.getSurfaceHolder();

                Canvas c=mySurfaceHolder.lockCanvas();

                //this is where I wanted to place my 2D drawing, but
after the above line, this is
                //what I got in the Log:
//11-20 12:52:02.508: ERROR/SurfaceComposerClient(490): eLocked set
when entering lock_layer(), //layer=1 (lcblk=0x410420a0),
state=0020
//11-20 12:52:02.598: ERROR/SurfaceHolder(490): Exception locking
surface

                mySurfaceHolder.unlockCanvasAndPost(c);

}

Any help would be very appreciated

Thanks!


--~--~-~--~~~---~--~~
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
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: 2D over 3D

2008-12-02 Thread Dianne Hackborn
Or follow the SurfaceView Overlay API Demo.

http://code.google.com/android/samples/ApiDemos/src/com/example/android/apis/graphics/

On Tue, Dec 2, 2008 at 11:11 AM, Robert Green [EMAIL PROTECTED] wrote:


 You can just do one square billboard positioned such that it is
 directly in front of the frustum.  The texture can be transparent and
 you just draw what you want to have show up.  That will be only 2
 additional polys for the 2D.

 On Dec 2, 9:56 am, fcalzada [EMAIL PROTECTED] wrote:
  Yes i thought about it, but it's gonna take some 3d resources... and
  my application is already quite heavy in vertices number
 
  On Dec 2, 3:51 pm, Robert Green [EMAIL PROTECTED] wrote:
 
   In desktop 3D stuff I've always just created billboards and drawn to
   the textures for them.  I'm sure this same technique would work.
 
   On Dec 2, 4:29 am, fcalzada [EMAIL PROTECTED] wrote:
 
Hi,
 
I'm having the same issue, I tried hard but without success.
Did you find a workaround ?
 
thanks
 
On Nov 20, 1:57 pm, petunio [EMAIL PROTECTED] wrote:
 
 Hi
 
 I am porting an application based on the sdk 3.0, and I am having
 countless problems...
 
 now, I am struggling trying to put 2D graphics on top of a 3D
 scene...
 
 After a lot of headache, I managed to create a opengl context,
 which
 now works, but when I try to put 2D graphics on top of it, this is
 what happens:
 
 public void drawFrame(GL10 gl)
 {
 //view is a SurfaceView, and the value is not null
 !
 mySurfaceHolder=view.getSurfaceHolder();
 
 Canvas c=mySurfaceHolder.lockCanvas();
 
 //this is where I wanted to place my 2D drawing,
 but
 after the above line, this is
 //what I got in the Log:
 //11-20 12:52:02.508: ERROR/SurfaceComposerClient(490): eLocked set
 when entering lock_layer(), //layer=1 (lcblk=0x410420a0),
 state=0020
 //11-20 12:52:02.598: ERROR/SurfaceHolder(490): Exception locking
 surface
 
 mySurfaceHolder.unlockCanvasAndPost(c);
 
 }
 
 Any help would be very appreciated
 
 Thanks!
 
 
 



-- 
Dianne Hackborn
Android framework engineer
[EMAIL PROTECTED]

Note: please don't send private questions to me, as I don't have time to
provide private support.  All such questions should be posted on public
forums, where I and others can see and answer them.

--~--~-~--~~~---~--~~
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
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---