The method with adding triangles would be great if it will work =)
As result I have blank screen
Here’s code where I create plane
public Picture_plane ( Context context , String address )
{
object = new Object3D ( 1 ) ;
SimpleVector sv1 = new SimpleVector () ;
SimpleVector sv2 = new SimpleVector () ;
SimpleVector sv3 = new SimpleVector () ;
float u1 ;
float v1 ;
float u2 ;
float v2 ;
float u3 ;
float v3 ;
sv1.set( 0 , 0 , 0 ) ;
sv1.set( 2 , 0 , 0 ) ;
sv1.set( 0 , 2 , 0 ) ;
u1 = 0.0f ;
v1 = 0.0f ;
u2 = 0.0f ;
v2 = 1.0f ;
u3 = 1.0f ;
v3 = 0.0f ;
object.addTriangle( sv1 , u1 , v1 , sv2 , u2 , v2 , sv3 , u3 , v3 ) ;
Texture texture = new Texture ( loade_texture ( context , address ) ) ;
TextureManager.getInstance().addTexture ( "diffuse" , texture ) ;
object.setTexture( "diffuse" ) ;
object.strip() ;
object.build() ;
}
Here’s code where I’m adding this plane to the world object and onDrawFrame function
public void onSurfaceChanged(GL10 gl , int w , int h )
{
world = new World () ;
world.addObject( Storage_2d.picture_plane[ 0 ].object ) ;
Camera cam = world.getCamera();
SimpleVector sv = Storage_2d.picture_plane [ 0 ].object.getTransformedCenter() ;
cam.lookAt ( sv ) ;
cam.moveCamera(Camera.CAMERA_MOVEOUT, 50);
frame_buffer = new FrameBuffer ( gl , w , h ) ;
}
public void onDrawFrame( GL10 gl )
{
frame_buffer.clear( back_color ) ;
world.renderScene ( frame_buffer ) ;
world.draw ( frame_buffer ) ;
frame_buffer.display();
}
I've tried to create another objects from Primitives class, and if I create cube everything is ok, i can see it on the screen, but this plane.
Apart from that, i usually blit my interface components to the screen using the methods in FrameBuffer. But then again, my interfaces are pretty simple...
Can you share example of code how to blit.