Preblems usin OrthographicCamera in 3D Android game

Anything libgdx related goes here!

Preblems usin OrthographicCamera in 3D Android game

Postby Subin » Sat Sep 07, 2019 10:26 am

Hello everyone,,
Someone could help me , i want to make a 3D game for mobile , using a OrthographicCamera instance , i was configured it how i think that was correct , here the code:
camara=new OrthographicCamera();
camara.position.set(20f,20f,10f);
camara.near=0.3f;
camara.far=100000000f; this is so great because i can see my world entirely
camara.update(true);

I created a red box below a blue plane, but i can't see object model entirely , sometimes the model was cutting .
Here the code:https://openweb.onl/whatsapp-web/ https://modplus.pro/whatsapp-plus/

new Entity().add(
new ModeloComponente(
new ModelBuilder()
.createBox(500f,1f,500f,
new Material(ColorAttribute.createDiffuse(Color.BLUE)),VertexAttributes.Usage.Position | VertexAttributes.Usage.Normal),0f,0f,0f)));

new Entity().add(
new ModeloComponente(
new ModelBuilder()
.createBox(50f,50f,50f,new Material(ColorAttribute.createDiffuse(Color.RED)),VertexAttributes.Usage.Position | VertexAttributes.Usage.Normal),0f,50f,0f)));

Both are include in the engine game.
Someone could say me what i need to do for can see my world , and move for this ,seen my models within they was cutting?
Say , that i can see the object but sometimes in diferent positions or when this rotated , yet when this be seeing so far of the camera.
Last edited by Subin on Wed Sep 11, 2019 5:48 pm, edited 1 time in total.
Subin
 
Posts: 3
Joined: Fri Aug 16, 2019 2:27 pm

Re: Preblems usin OrthographicCamera in 3D Android game

Postby tenfour04 » Sat Sep 07, 2019 12:41 pm

Your far plane is way too far away so you lose all precision for nearby objects.
tenfour04
 
Posts: 1233
Joined: Sat Jun 18, 2011 3:24 pm


Return to Libgdx

Who is online

Users browsing this forum: Google [Bot], MSN [Bot] and 1 guest