May 23, 2012, 12:38:17 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: Please report any bugs or issues that you might be encountering with the Beta in the Support System so that we can better keep track of any oustanding issues that may come up.

GameCore Support System
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Camera questions  (Read 675 times)
pixel_legolas
Hero Member
*****
Posts: 786


View Profile
« on: March 01, 2009, 05:10:44 PM »

Hi!

I am doing a basic model viewer in gamecore and I have used the camera script from MARBLE GAME. It has a orbiting camera and you can zoom in and out. The problem is I changed the sphere to another model. When I zoom in it looks like it is zooming to the bottom of the character. I want it to zoom to center of object because when zooming in I only see the legs, I like it to show torso and up.

Should I post a demo or do you understand my problem? Smiley

« Last Edit: March 01, 2009, 05:13:31 PM by pixel_legolas » Logged
Ransom
Full Member
***
Posts: 132



View Profile
« Reply #1 on: March 02, 2009, 09:01:23 AM »

You just need to adjust the Y axis of the focus point.  Something like...
Quote
//pseudo code

Vector camFocus = camera.GetFocus();
camFocus.Y += 1;  // or however high it needs to be
camera.SetFocus(camFocus);

Logged
pixel_legolas
Hero Member
*****
Posts: 786


View Profile
« Reply #2 on: March 02, 2009, 04:20:56 PM »

This is the code for setting up the camera:

Quote
void Initialize( Object@ object)
{
   LoadControllerSettings( object);


   // set the initial camera position relative to the object
   Matrix mtx;
   mtx.SetRotate( headingAngle, 0, 0);
   headingAngle = 0;
   Vector camDir = mtx.ZAxis;
   camDir *= cos( pitchAngle);
   camDir.y = sin( pitchAngle);
   cameraPos = object.GetCurMatrix().T;
   cameraPos += (cameraPos * zoom);
    cameraPos.y += 100;
   
}

The red area is what I added but nothing happens, no matter if I add 1 or 100. I feel stupid Smiley
Logged
Ransom
Full Member
***
Posts: 132



View Profile
« Reply #3 on: March 02, 2009, 04:37:13 PM »

That probably doesn't work because its changed later in ControllerCamera section, the initialize section is only read once.
Also, you don't want to edit the position unless you want the camera to be closer or further from the player.  You just want the camera to look at a higher point, right?


Now that I think about it, there should be a variable declared at the top, something like "cameraOffset", look for that and just make the Y value higher.  Sorry I can't be of more help, but I'm at work and can't test this stuff.  I know what you're trying to do is simple though, you can do it!
Logged
BigDaz
Sr. Member
****
Posts: 345


HardCore


View Profile
« Reply #4 on: March 02, 2009, 05:08:34 PM »

The camera setup is at the bottom of the push_ball.gsl.
Looks a bit complicated to me.
You might want to look at the camera control from the vehicle script, it basically does the same thing but you can simply specify a target height for the camera in the vehicle properties.
Logged
Squat
Hero Member
*****
Posts: 592


View Profile
« Reply #5 on: March 02, 2009, 06:26:31 PM »

I think the camera position and target parameters are exposed in the controller variables, thus editable in the editor. This is true for the standard network player control script at least.
Logged
pixel_legolas
Hero Member
*****
Posts: 786


View Profile
« Reply #6 on: March 02, 2009, 07:05:34 PM »

I'm gonna try some stuff tomorrow but I don't understand why zooming in makes it zoom to bottom of character. Whe zooming close it lands at feet. It if uses the matrix of object it should be at objects center Smiley
Logged
Ransom
Full Member
***
Posts: 132



View Profile
« Reply #7 on: March 03, 2009, 09:53:35 AM »

Not necessarily, the Y focus point is probably 0 or 0.5 - you just need to locate where that is established and add 1 or so to it.
Logged
Pages: [1]
  Print  
 
Jump to:  

 
Powered by MySQL Powered by PHP bluBlur Skin © 2006, hbSkins
Powered by SMF 1.1.14 | SMF © 2006-2011, Simple Machines LLC
Valid XHTML 1.0! Valid CSS!