Author Topic: Question,how to set two camera in jpct?  (Read 7468 times)

Offline gamenewer

  • long
  • ***
  • Posts: 171
    • View Profile
Re: Question,how to set two camera in jpct?
« Reply #15 on: October 22, 2014, 03:29:02 am »
How about the framerate in this case ?

Offline Uncle Ray

  • int
  • **
  • Posts: 81
    • View Profile
Re: Question,how to set two camera in jpct?
« Reply #16 on: October 22, 2014, 06:34:33 am »
a little drop,but not much.

Offline Uncle Ray

  • int
  • **
  • Posts: 81
    • View Profile
Re: Question,how to set two camera in jpct?
« Reply #17 on: October 22, 2014, 06:36:53 am »
How about the framerate in this case ?

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

Offline Uncle Ray

  • int
  • **
  • Posts: 81
    • View Profile
Re: Question,how to set two camera in jpct?
« Reply #18 on: October 22, 2014, 09:24:38 am »
i had made a mistake,they just the same camera....

Offline Uncle Ray

  • int
  • **
  • Posts: 81
    • View Profile
Re: Question,how to set two camera in jpct?
« Reply #19 on: October 22, 2014, 11:23:32 am »
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.

Offline Uncle Ray

  • int
  • **
  • Posts: 81
    • View Profile
Re: Question,how to set two camera in jpct?
« Reply #20 on: October 22, 2014, 11:29:04 am »
i think problem is how to switch camera?


Offline Thomas.

  • double
  • *****
  • Posts: 833
    • View Profile
Re: Question,how to set two camera in jpct?
« Reply #21 on: October 22, 2014, 12:16:03 pm »
You have to use method World.setCameraTo(...)

Offline Uncle Ray

  • int
  • **
  • Posts: 81
    • View Profile
Re: Question,how to set two camera in jpct?
« Reply #22 on: October 22, 2014, 03:55:41 pm »
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();
      
       }
« Last Edit: October 22, 2014, 04:10:16 pm by Uncle Ray »