forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

2d camera?

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development
View previous topic :: View next topic  
Author Message
nDEV



Joined: 13 Apr 2007
Posts: 48

PostPosted: Thu May 17, 2007 6:13 pm    Post subject: 2d camera? Reply with quote

Hello , im making a 2d shooter game but with also some 3d effects!
Im stuck with the 2d camera , can someone help me?

The game is tile based , it uses a file to load every character , and then , it fills an array called char MAP[25][25].

Any help?
Back to top
View user's profile Send private message
ufoz



Joined: 10 Nov 2005
Posts: 86
Location: Tokyo

PostPosted: Thu May 17, 2007 7:18 pm    Post subject: Reply with quote

Help with... what? Setting up the projection matrix?
Back to top
View user's profile Send private message Visit poster's website AIM Address MSN Messenger
nDEV



Joined: 13 Apr 2007
Posts: 48

PostPosted: Thu May 17, 2007 7:32 pm    Post subject: Reply with quote

ufoz wrote:
Help with... what? Setting up the projection matrix?

Well , i want the camera to follow player's object !
How can i do it?


thanks
Back to top
View user's profile Send private message
nDEV



Joined: 13 Apr 2007
Posts: 48

PostPosted: Fri May 18, 2007 7:36 pm    Post subject: Reply with quote

Im not asking for full source , just some theory , or maybe pseudo code!


th@nks.
Back to top
View user's profile Send private message
rapso



Joined: 28 Mar 2005
Posts: 147

PostPosted: Fri May 18, 2007 9:43 pm    Post subject: Reply with quote

dont move the players object, just keep it in center of the camera/view during rendering, but move everything else.
Back to top
View user's profile Send private message
nDEV



Joined: 13 Apr 2007
Posts: 48

PostPosted: Fri May 18, 2007 10:35 pm    Post subject: Reply with quote

rapso wrote:
dont move the players object, just keep it in center of the camera/view during rendering, but move everything else.


Wah , i think i know how to do it!

To keep the player in the center of the screen , i will need something like this:

x = WindowWIDTH /2 - PLAYERWIDTH/2;
y = WindowHeight /2 - PLAYERHEIGHT /2;


Then i just have to scroll the world(array) left/up/down/right ?..
Back to top
View user's profile Send private message
rapso



Joined: 28 Mar 2005
Posts: 147

PostPosted: Fri May 18, 2007 10:44 pm    Post subject: Reply with quote

nDEV wrote:

Then i just have to scroll the world(array) left/up/down/right ?..
exactly!
kinda by the reversed position of the players-object.
Back to top
View user's profile Send private message
nDEV



Joined: 13 Apr 2007
Posts: 48

PostPosted: Sat May 19, 2007 3:22 am    Post subject: Reply with quote

ok thanks!
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
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 vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group