Question,how to set two camera in jpct?

Started by Uncle Ray, October 20, 2014, 02:43:01 PM

Previous topic - Next topic

gamenewer


Uncle Ray


Uncle Ray

Quote from: gamenewer on October 22, 2014, 03:29:02 AM
How about the framerate in this case ?

maybe you came from china,we can talk in qq
(my qq:409544041)

Uncle Ray

i had made a mistake,they just the same camera....

Uncle Ray

I still failed,i have search all of this forum and google,all of them are not anything about how to set two camera in jpct.
Anyone helps one,thx.

Uncle Ray

i think problem is how to switch camera?



Uncle Ray

#22
thanks to ego and thomas,the problem solved here is the code.
cam1.cam01=world.getcamera;//
           //first rendering
           world.setCameraTo(cam2.cam01);   
       cam2.move(world, missile01,2);
       fb.setRenderTarget(mtexture);
       fb.clear(back);
       world.renderScene(fb);
       world.draw(fb);
       fb.display();
       fb.removeRenderTarget();
   
       //second rendering
       world.setCameraTo(cam1.cam01);   //without this,two views would be share the same camera.
       cam1.move(world,tes1,1);
       fb.clear(back); 
       world.renderScene(fb);
       world.draw(fb);
      
   fb.blit(mtexture, 0, 0,device_width*5/6, 8,256,   -256,device_width/6,device_height/5,100,false);//-256 must negative,otherwise the second camera would be reverse   
      
       fb.display();
      
       }