#1
12th May 2009 at 10:41 AM
Last edited by MogHughson : 12th May 2009 at
10:57 AM.
Reason: Added link to second tut
Tutorial on Custom Cameras for Thumbnails
In 99% of cases, an object modder will not worry about the thumbnails used for their object since the game will automatically create them. You may occaisionally go into the Thumbnails folder to delete them*, thus forcing the game to regenerate them for you but that's probably all that you ever do with Thumbnails. Sometimes, however, the icons generated by the game are not quite what you want because the default camera angle chosen by the game is not showing you what you want.
There are some other tutorials about custom icons:
This tutorial is specifically about custom camera angles for object thumbnails. This tutorial assumes that you are comfortable using SimPE. Screenshots are taken from
SimPE v0.72.1.33855
*When messing about with thumbnails it is also useful to know that holding down <CTRL> and right-mouse clicking on a thumbnail will refresh only that one - quicker than deleting the entire file of thumbnails and waiting for the game to regenerate them all.
A custom camera
In order to have a custom camera angle on a thumbnail you need to add what is called a custom camera. To do this you need to add another CRES to your package (in addition to the CRES of your object). The CRES you add is a special CRES and as ever the easiest way is to grab one from another object and add it into your package. Use the Finder tool to look for one, which has a name ending in _thumbnailShape_cres.
The results window will provide you with the file name and resource name to make it easy for you to find it and extract it.
Now open up your object's package and add this extracted CRES to the package. Rename the part before _thumbnailshape_cres to be appropriate for your package (remember there are two places the name must be updated) and run a
Tools->Object Tools...->Fix Integrity... which will update the Group value for you. We will refer to this CRES as the
thumbnail CRES and the original CRES in this package as the
object CRES. While you are in there, copy the text selected by the blue box (everything up to, but not including the _cres).
Now in the
object CRES open the block named thumbnailExtension.
Add an Array item giving it the name of the
thumbnail CRES - the text you just copied. No items are required. Press Commit.
This next part is the difficult part. Open up the
thumbnail CRES. You will see it has just one node, cViewerRefNode, which is where we will now attempt to customize the camera position and rotation.
I am not an expert in camera angles, but what I will try to explain here is what the various numbers mean and one basic angle.
Centered, facing your object
I used X=0; Y=1.5; Z=0.5; R=180
Translation: X
If you want to move left use positive numbers, and if you want to move right, use negative numbers. My object in this case was centred on zero, if yours is not you may want half a tiles movement one way or another to centre it.
Translation: Y
If you want the camera to move backwards away from your object use positive numbers. The Y = 1.5 that I chose allows a 1-tile face to fill the thumbnail space. If your object is bigger or you want to be a little further away, try a bigger number. Negative numbers do the opposite, i.e, move the camera forward.
Translation: Z
This is the height of the camera measured in tiles. Positive numbers move it up, negative numbers move it down. In my case with Z = 0.5 this would be centred on the height of a 1-tile face (which was standing on the ground).
Rotation
I rotated around the Z axis. This can be done by setting Rotation: Z = 1 and Angle = 180
or Euler Rotation: R = 180 - you can enter the rotation in whichever fields suit the way you think. These both imply the camera is facing away from the user, i.e. towards the object. Rotation around the Z axis is in a counter-clockwise direction if you look down from the top. Rotating around the Y axis is in a clockwise direction if you look from the front.
Credits :lovestruc
I can claim no credit myself for discovering this behaviour. All the credit goes to Jasana_BugBreeder for setting me on the right tracks when I needed to do exactly this. My thanks to her, and I hope I have captured all her notes in this tutorial for future reference. She provides this additional wisdom.
Quote:
In theory, you should be able to get camera position from your 3D-editor, convert it to euler angles and just use it here. The problem is, 3D-editor cameras (0,0,0) may differ from Sims camera (0,0,0), so you'll need to handle it - and simply substracting the angle won't work. It's quaternion math, which is difficult. It is best to use the simplest rotations possible, in order to be able to translate them correctly into Sims rotation. Beware, with rotations, any wrong sign or value can take your object out of the camera's view!
|
If there is anything that should be said about this, let me know and I'll add it here.