This site is no longer active and is available for archival purposes only. Registration and login is disabled.

Question about camera


Question about camera

Postby PocketPlay » Jul 24, 2009 @ 12:04am

PocketPlay
pm Member
 
Posts: 12
Joined: Jul 3, 2009 @ 8:59pm


Postby PocketPlay » Jul 25, 2009 @ 3:17pm

Do you guys even check this board anymore ? :?
PocketPlay
pm Member
 
Posts: 12
Joined: Jul 3, 2009 @ 8:59pm


Postby edge » Jul 27, 2009 @ 1:15pm

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?
EDGELIB: Cross-platform mobile development at your fingertips
http://www.edgelib.com
User avatar
edge
pm Member
 
Posts: 1180
Joined: Aug 22, 2005 @ 3:42pm
Location: The Netherlands


Postby PocketPlay » Jul 27, 2009 @ 6:42pm

PocketPlay
pm Member
 
Posts: 12
Joined: Jul 3, 2009 @ 8:59pm


Postby edge » Jul 28, 2009 @ 11:10am

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.
EDGELIB: Cross-platform mobile development at your fingertips
http://www.edgelib.com
User avatar
edge
pm Member
 
Posts: 1180
Joined: Aug 22, 2005 @ 3:42pm
Location: The Netherlands


Postby PocketPlay » Jul 28, 2009 @ 1:57pm

PocketPlay
pm Member
 
Posts: 12
Joined: Jul 3, 2009 @ 8:59pm


Postby PocketPlay » Jul 28, 2009 @ 11:54pm

PocketPlay
pm Member
 
Posts: 12
Joined: Jul 3, 2009 @ 8:59pm


Postby Kak » Jul 29, 2009 @ 8:20am

User avatar
Kak
pm Member
 
Posts: 291
Joined: Jul 26, 2003 @ 12:24pm
Location: Zannarkand, Spira


Postby PocketPlay » Jul 30, 2009 @ 12:55am

so I should call WorldTranslate
( 0, 0, 5000-player.getZ() )
instead of
( 0, 0, player.getZ()-5000) )

because of the z axis orientation?
PocketPlay
pm Member
 
Posts: 12
Joined: Jul 3, 2009 @ 8:59pm


Postby edge » Jul 30, 2009 @ 9:38am

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.
EDGELIB: Cross-platform mobile development at your fingertips
http://www.edgelib.com
User avatar
edge
pm Member
 
Posts: 1180
Joined: Aug 22, 2005 @ 3:42pm
Location: The Netherlands


Postby PocketPlay » Jul 31, 2009 @ 12:05am

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.
PocketPlay
pm Member
 
Posts: 12
Joined: Jul 3, 2009 @ 8:59pm


Postby PocketPlay » Aug 2, 2009 @ 1:23am

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?
PocketPlay
pm Member
 
Posts: 12
Joined: Jul 3, 2009 @ 8:59pm


Postby edge » Aug 5, 2009 @ 1:25pm

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).
EDGELIB: Cross-platform mobile development at your fingertips
http://www.edgelib.com
User avatar
edge
pm Member
 
Posts: 1180
Joined: Aug 22, 2005 @ 3:42pm
Location: The Netherlands


Postby PocketPlay » Aug 6, 2009 @ 4:44pm

that sounds very plausible.

is there any way I can disable this in Edgelib?
PocketPlay
pm Member
 
Posts: 12
Joined: Jul 3, 2009 @ 8:59pm


Postby edge » Aug 11, 2009 @ 10:27am

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).
EDGELIB: Cross-platform mobile development at your fingertips
http://www.edgelib.com
User avatar
edge
pm Member
 
Posts: 1180
Joined: Aug 22, 2005 @ 3:42pm
Location: The Netherlands


Next

Return to EDGELIB


Sort


Forum Description

Powerful and affordable C++ middleware solution covering true multi-platform 2D, 3D and network features for Apple iPhone, Windows Mobile, Symbian S60, UIQ, Linux and Windows desktop.

Moderator:

edge

Forum permissions

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

cron