It is currently Tue Dec 12, 2017 6:45 pm

All times are UTC - 5 hours




 Page 1 of 1 [ 11 posts ] 
Author Message
 Post subject: GameDev VMK 32 - Parsing Binary Files
PostPosted: Tue Feb 13, 2007 7:05 am 
Site Admin

Joined: Sun Feb 11, 2007 8:59 am
Posts: 1105
Location: Ontario Canada
The camera class enables you to view the 3D scene from different positions.


Offline
 Profile  
 
 Post subject: Re: GameDev VMK 8 - Camera class
PostPosted: Tue Jun 19, 2007 12:30 am 

Joined: Tue May 01, 2007 2:55 pm
Posts: 96
Location: Behind you
In this class you have a member variable m_v3SideDirection which should always be perpendicular to m_v3LookDirection. Now I wonder, isn't this just redundancy?


Offline
 Profile  
 
 Post subject: Re: GameDev VMK 8 - Camera class
PostPosted: Tue Jun 19, 2007 12:45 am 

Joined: Tue May 01, 2007 2:55 pm
Posts: 96
Location: Behind you
okey I now I am being a pain :P but I have yet another question



You set the m_fAngularSpeed to 25.0f and say it's radians per second, but that would mean almost four full circles in 1 second, is that what you intend?


Offline
 Profile  
 
 Post subject: Re: GameDev VMK 8 - Camera class
PostPosted: Tue Jun 19, 2007 6:11 am 
Site Admin

Joined: Sun Feb 11, 2007 8:59 am
Posts: 1105
Location: Ontario Canada
Re: m_v3SideDirection. You need this variable because without it, you can not uniquely define your direction in 3D that you are looking in. For example, imagine that you are looking in the direction of (-1, -1, +1). Without the sideDirection vector you would not know if you are upsidedown or right side up. There are actually an infinite number of poses that could be in and still have your gaze directed in (-1,-1,+1). Because of this we need that extra vector to contrain the direction to only one solution.

Re: m_fAngularSpeed. Hmmm, that does seem a bit high, but don't worry. We change this value to 2.0f a little later on.


[/color]


Offline
 Profile  
 
 Post subject: Re: GameDev VMK 8 - Camera class
PostPosted: Fri Aug 31, 2007 2:31 am 

Joined: Tue May 01, 2007 2:55 pm
Posts: 96
Location: Behind you
about m_v3SideDirection, this is a vector - do actually input and output that really as a vector later on? Or do you input an angle and convert it to a vector and again convert the vector to an angle before outputting it?



If the last, isn't it better to store an angle directly?


Offline
 Profile  
 
 Post subject: Re: GameDev VMK 8 - Camera class
PostPosted: Fri Aug 31, 2007 5:55 am 
Site Admin

Joined: Sun Feb 11, 2007 8:59 am
Posts: 1105
Location: Ontario Canada
When moving around in the world you need to know which "direction" to go that is why all the work is done by using vectors.


Offline
 Profile  
 
 Post subject: Re: GameDev VMK 8 - Camera class
PostPosted: Wed Sep 19, 2007 6:26 pm 

Joined: Wed Sep 19, 2007 5:01 pm
Posts: 5
I was wondering about a "fly-by" camera. currently moving forward or strafing my camera moves on a plane. So looking up or down does not allow me to move forward through the floor or up in the sky. (accidental floor collition if you will). I was wondering why this may be, I have a UP vector, but I dont use it for anything, in fact(which i will need to fix) i dont change it when i look around. So if i wanted my camera to "fly" I what would i need to change/fix?


Offline
 Profile  
 
 Post subject: Re: GameDev VMK 8 - Camera class
PostPosted: Wed Sep 19, 2007 6:41 pm 
Site Admin

Joined: Sun Feb 11, 2007 8:59 am
Posts: 1105
Location: Ontario Canada
The camera navigation in the video's only allow you to move in the X,Z plane. Y is always fixed (unless you crouch or jump). to change this to allow you to "fly" you will need to update your motion so that you move in all X,Y,Z axes in the direction that you are facing.


Offline
 Profile  
 
 Post subject: Re: GameDev VMK 8 - Camera class
PostPosted: Wed Sep 19, 2007 7:47 pm 

Joined: Wed Sep 19, 2007 5:01 pm
Posts: 5
what i mean is to change to orientation of the camera axis, os if the camera starts at default 0,0,0 then looks up 30degrees, that angle the camera is facing in is the z axis so moving forward in the Z you move "up" in the world.



i guess what i am thinking is if your character was a plan in FPS mode,
the planes up vector is always the same, and its right vector is still
perpendicular to the direction but the plane goes up and down to where
it is facing.



I understand what you are saying to then move up like



case FORWARD:

camPosition -= camDirection*GameSpeed*movementSpeed;

camPosition -= camUp*GameSpeed*movementSpeed;



break;



can the vaule of Y, but i dont want that value change just axis orientation.



 



 


Offline
 Profile  
 
 Post subject: Re: GameDev VMK 8 - Camera class
PostPosted: Wed Sep 19, 2007 7:54 pm 
Site Admin

Joined: Sun Feb 11, 2007 8:59 am
Posts: 1105
Location: Ontario Canada
The axis of the world is always fixed. X to the right, Y up and Z in/out of the monitor. If you want to "move up" you have to change the Y value. You can do this by either explicitly changing your Y co-ordinate, or by appling a rotation about the global axis and then walking up/down along the sloped axis. If you want to change your axis, just call glRotate before you do your translation. Similar to how the camera motion is controlled by the mouse. Once you get the the scene graph section this will make a lot more sense.


Offline
 Profile  
 
 Post subject: Re: GameDev VMK 8 - Camera class
PostPosted: Fri Nov 02, 2007 7:04 pm 

Joined: Tue May 01, 2007 2:55 pm
Posts: 96
Location: Behind you
You made little error in your comments.



You are talking about a speed in units per second, but in the next VMK you are actually going to implement it as a speed in units per milisecond. Nothing too big, but it had me puzzled as my times are in seconds (that's how GLFW passes them to me).


Offline
 Profile  
 
Display posts from previous:  Sort by  
 Page 1 of 1 [ 11 posts ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 0 guests


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

Jump to:  

cron