Page 1 of 2

Question about camera

PostPosted: Jul 24, 2009 @ 12:04am
by PocketPlay

PostPosted: Jul 25, 2009 @ 3:17pm
by PocketPlay
Do you guys even check this board anymore ? :?

PostPosted: Jul 27, 2009 @ 1:15pm
by edge
Hi PocketPlay,

Your code seems fine, although I'm missing the Reset and WorldReset calls from your sample. Are you calling the reset functions before translating?

PostPosted: Jul 27, 2009 @ 6:42pm
by PocketPlay

PostPosted: Jul 28, 2009 @ 11:10am
by edge
Hi PocketPlay,

When translating the world, reverse the x, y and z parameters. Then it should work correctly.

If it still doesn't work, change the order of the translate and rotate calls.

PostPosted: Jul 28, 2009 @ 1:57pm
by PocketPlay

PostPosted: Jul 28, 2009 @ 11:54pm
by PocketPlay

PostPosted: Jul 29, 2009 @ 8:20am
by Kak

PostPosted: Jul 30, 2009 @ 12:55am
by PocketPlay
so I should call WorldTranslate
( 0, 0, 5000-player.getZ() )
instead of
( 0, 0, player.getZ()-5000) )

because of the z axis orientation?

PostPosted: Jul 30, 2009 @ 9:38am
by edge
Hi PocketPlay,

You should call it like this:
Translate(0, 0, -player.getZ() - 5000);

The player position is inverted and the camera is placed 5000 units behind the player.

PostPosted: Jul 31, 2009 @ 12:05am
by PocketPlay
yeah, allright. thanks.

I also have one more question: when I call

display->Perspective3D(display->GetWidth(), display->GetHeight(), 512, 0, 2000);

isn't the camera supposed to move at y = 2000 in the World coordinates? seems like it's always located at y = 0, even if I change those offset params.

PostPosted: Aug 2, 2009 @ 1:23am
by PocketPlay
the reason I'm asking is because I 'm trying to render two models: player and floor. and for some reason, when I move the floor along Y axis sometimes it disappears.

could that be because the model is out of the camera view?

PostPosted: Aug 5, 2009 @ 1:25pm
by edge
Hi PocketPlay,

The offset parameters to Perspective3D are for transforming the frustum and don't relate to world coordinates. In most cases you should use the default parameters for those.

It could be possible that the floor disappears if you're looking at the bottom of it, and not from the top. This happens when backface culling is enabled (polygons will only be viewed from the frontside and not from the backside).

PostPosted: Aug 6, 2009 @ 4:44pm
by PocketPlay
that sounds very plausible.

is there any way I can disable this in Edgelib?

PostPosted: Aug 11, 2009 @ 10:27am
by edge
Hi,

You can disable backface culling by calling glDisable(GL_CULL_FACE). You can also create 2 planes, one for each side and let them use the same coordinates ('attach' them to each other).