Panning Camera
by Ronald J Nelson · in Torque Game Engine · 12/08/2006 (10:16 pm) · 6 replies
I need to set up a camera that is centered on an object say a character. The camera cannot zoom away or in, it cannot go below the terrain, finally it needs an automated pannning ability so it continues to circle around the object.
Anyone have any ideas? So far I have seen planty of forum posts and a couple resources for a pathed camera. However, this camera isn't really following a path, its stuck in one place, it just pans around an object.
Kind of like the object viewer, but a camera.
Anyone have any ideas? So far I have seen planty of forum posts and a couple resources for a pathed camera. However, this camera isn't really following a path, its stuck in one place, it just pans around an object.
Kind of like the object viewer, but a camera.
#2
www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=10668
I am having a problem with this resource. Frankly it kills the load up screens in its current state. I have tried moving the loadMission() function to the StartupGui.gui funtion that used to load the main menu, it causes a crash everythime I try to load a regular mission now.
The failure it gives me is:
Connection error: Invalid packet GameBase::unpackUpdate().
I ran it in debug and this is what I got:
Fatal: (c:\torque\sdk\engine\core\bitstream.h @ 257) Out of bounds value!
Apparently the placement of loadMission() is not a big deal either in initClient() because this is where I moved it:
Thats right, directly after the if/else that loads the StartupGui.gui functions in the first place. If I comment out loadMainMenu(); and use it in:
It will crash with the errors I listed above. Any ideas anyone?
12/10/2006 (10:49 pm)
Well Brian as it turns out the Advanced Camera Resource is already a part of TGE 1.5. I am working on using it now. However, it was in conjunction with this resource:www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=10668
I am having a problem with this resource. Frankly it kills the load up screens in its current state. I have tried moving the loadMission() function to the StartupGui.gui funtion that used to load the main menu, it causes a crash everythime I try to load a regular mission now.
The failure it gives me is:
Connection error: Invalid packet GameBase::unpackUpdate().
I ran it in debug and this is what I got:
Fatal: (c:\torque\sdk\engine\core\bitstream.h @ 257) Out of bounds value!
Apparently the placement of loadMission() is not a big deal either in initClient() because this is where I moved it:
if ($JoinGameAddress !$= "") {
// If we are instantly connecting to an address, load the
// main menu then attempt the connect.
loadMainMenu();
connect($JoinGameAddress, "", $Pref::Player::Name);
}
else {
// Otherwise go to the splash screen.
Canvas.setCursor("DefaultCursor");
loadStartup();
}
// Start up the main menu... this is separated out into a
// method for easier mod override.
loadMainMenu();Thats right, directly after the if/else that loads the StartupGui.gui functions in the first place. If I comment out loadMainMenu(); and use it in:
function checkStartupDone()
{
if (StartupGui.done)
{
loadMainMenu();
}
else
schedule(100, 0, checkStartupDone();
}It will crash with the errors I listed above. Any ideas anyone?
#3
Is there no one that has an idea why this is happening?
12/11/2006 (3:06 pm)
OK I have even added gui deletes and texture cache flushes after each gui closes, still I have a problem. Is there no one that has an idea why this is happening?
#4
12/11/2006 (4:41 pm)
Oh and if anyone knows how, is there someway to make the orbit mode spin on its own? I am guessing it is just a matter of making the mouse in put for the x-axis actually have a value?
#5
So to continue using Gary's script I am just going to have to re-merge the script in to mine.
As for the rest I figured it out. It works really nice and blows using the 3d object viewer out of the water since you can have a whole scene as your backdrop for viewing your car.
12/11/2006 (11:19 pm)
As for my bug, disregard it I found the solution. Ironically it was not my own error. Apparently the ODEScript Resource really doesn't like the mission in the menu resource now that Gary changed the script into a user mod. It had to do with the seperate mission loading functions, for some reason it just didn't like it.So to continue using Gary's script I am just going to have to re-merge the script in to mine.
As for the rest I figured it out. It works really nice and blows using the 3d object viewer out of the water since you can have a whole scene as your backdrop for viewing your car.
#6
12/12/2006 (12:11 am)
Here is a small video to show what I got done. I set it up as a package system with the ability to have unique "missions/gametypes" for each view. Each has its own terrain mission files and script. I also added a separate loading mission screen that differentiates between regular missions and the menu viewer missions. They work just like a real mission and can have all of the elements that go with that, grass, BOTS, weather, ect. So the possiblities are endless.
Torque Owner Brian Hill
http://www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=5471
The OrbitMode sounds a lot like what you are descrbing -- just don't allow the zoom functionality.