|
||
|
| Tutorial 10: Shadow Models for Scenery Objects Introduction Trainz is able to show shadows on rolling stock and spline models (bridges and track) if a shadow mesh is made. The Spanish site (Vías3D) has an article in Spanish by Paco Rodríguez explaining how to have shadows on scenery objects. I thank him for the idea, very innovative. http://www.vias3d.net/web/?ver=Descargas&s=1&t=430&c=1&o=2 I have used the idea on my recent model of the Komatsu Excavator. While I have made an animated version of the model, the concept is realistic only for static models, the shadow is made as a spline and will not move to follow an animation. The Concept The static model is classed as Kind Buildable which allows you to have attached track. A Spline is made with an invisible base model, and using a shadow model of the excavator (black mesh model). The spline is called up as attached track in the original excavator model config. Komatsu Model A normal scenery model is made in 3dsmax or gmax, but to match the requirements for constructing a spline, it must start on the origin and run in the direction of the –Y axis. Two attachment points are placed for the shadow spline Kind track, a.track0a on the origin and a.track0b at -11.8 metres along the Y axis, the spline length will match the model length (11.8 metres).
The config for the main model is as follows, Kind buildable, and with the attached shadow spline called up in the track container, note the kuid for the shadow spline model, kuid2:60238:37054:1, and the attachment points:
The Shadow Spline Take the main mesh and clone it, remove all the small details that will not display in a shadow, and texture it black – just drop a single sided black texture on it, the existing mapping will distribute the colour. If you have any holes in the mesh they must be capped or sealed, otherwise streaks of shadow will be seen from the holes to the ground. Reduce the shadow mesh to the simplest possible, enough to show the 3D outline shapes. If the model has many polys, create new closed boxes to closely follow the 3D outline shape of the original model, and use this as the shadow mesh.
We need an invisible object to create the basic spline, as you cannot export a .im file without at least one polygon. For the spline object draw a small plane on the ground on the origin, place it 2 metres below ground for example, texture and map it black, then flip the normals so they point downwards. This makes an invisible object, provided the black texture were single sided, the texture I have called shadowblack.tga is 32 by 32. Create the following directory structure for the shadow spline:
Export the black plane object made earlier as the default.im mesh into the main directory as above, with the shadowblack texture used. Make a subdirectory as shown for the shadow itself, and export the black shadow model as default_shadow.im with its black texture. Use the repeats 1 tag so there is only one length of the spline placed. Make sure you use the file names above, you need to use consistent names recognised by Trainz so the shadow file can be found by the spline, since we cannot use a mesh table to reference it otherwise. The spline config will be Kind track. Use the following layout for the tags, make sure you use all the tags shown, including the important asset-filename tag “default” which matches the default.im name. Specify the length of the spline. Note that if you use a long spline, you should increase the length of the spline in the config by 1%, eg the gmax model is 100 metres, use 101 in the config, Trainz has an error that can truncate splines by 1%, noticeable in long splines. This spline kuid is called up in the main model config file:
Note that for a spline you do not have to place attachment points in the spline mesh in gmax. The Kind spline automatically generates them in Surveyor. Import the original model and the shadow spline into Trainz CMP or in the correct Custom Directories in TRS2004. Place the model in Surveyor and you should see a shadow of the model on the ground.
My object was height adjustable and this is what the shadow model looks like when the excavator is raised from the ground:
Summary Shadows can make a scenery object more believable. The process above is not really difficult. The full tutorial is available for download as a pdf: Shadow Models for Scenery Objects Ian Manion (Vulcan) May 2008 Amendment Notes and Comments 28/05/08 Initial issue. |
|