Transport Tycoon Forums

The place to talk about Transport Tycoon
It is currently Mon Aug 20, 2018 11:22 am

All times are UTC




Post new topic  Reply to topic  [ 116 posts ]  Go to page Previous 1 2 3 4 5 6 Next
Author Message
PostPosted: Sat Apr 03, 2010 2:31 pm 
Offline
Traffic Manager
Traffic Manager

Joined: Sun Dec 09, 2007 10:29 pm
Posts: 223
Can you translate that to English?

This my friend, is why I don't use Sketchup.

_________________
_______________________________________________________
Member of Chicago Locomotive Works.
Image


Top
   
PostPosted: Sat Apr 03, 2010 2:32 pm 
Offline
Chairman
Chairman
User avatar

Joined: Sat Mar 06, 2010 10:34 pm
Posts: 856
Location: Canada
Which program do you use lego? (I'm assuming blender or 3dsm)

_________________
Locomotion Related:
Northern Ontario & Quebec


Top
   
PostPosted: Sat Apr 03, 2010 2:40 pm 
Offline
Traffic Manager
Traffic Manager

Joined: Sun Dec 09, 2007 10:29 pm
Posts: 223
I have an older version of Max. I can't afford or really need to upgrade just for Locomotion. Like most of people that make trains in Max, I learned in GMax following tutorials for MSTS trains. Unfortunately, It is almost impossible to get Gmax models into Max. I have a really nice BR V100 in Gmax I can't render.

_________________
_______________________________________________________
Member of Chicago Locomotive Works.
Image


Top
   
PostPosted: Sat Apr 10, 2010 1:10 pm 
Offline
Chief Executive
Chief Executive

Joined: Sun Nov 20, 2005 12:10 pm
Posts: 675
Location: Australia; Melbourne


Is it me; or does it look like silk?

_________________
Image


Top
   
PostPosted: Sun Apr 18, 2010 12:05 am 
Offline
Chairman
Chairman
User avatar

Joined: Sat Mar 06, 2010 10:34 pm
Posts: 856
Location: Canada
Ok I've been busy for a while but I want to know if there is a way to get the sprites out of blender.

If not I'll keep looking for some cheap software, cause I can't afford something like 3dsm.

_________________
Locomotion Related:
Northern Ontario & Quebec


Top
   
PostPosted: Sun Apr 18, 2010 12:33 am 
Offline
Chief Executive
Chief Executive

Joined: Sun Nov 20, 2005 12:10 pm
Posts: 675
Location: Australia; Melbourne
What you have to do, is learn about the camera, and rather then create an animation, where the object goes over the 250 frames in a flowing motion, you have to set it so that each frame = 1 sprite, and then all renders go into your (C:/tmp) folder... you can also set what the images come out as... set it to png.

You just reminded me to ask blenderguru about setting a script to do this automatically, and if its possible. :wink: (Thanks for reminding me)

_________________
Image


Top
   
PostPosted: Fri Apr 23, 2010 4:40 pm 
Offline
Chairman
Chairman
User avatar

Joined: Sat Mar 06, 2010 10:34 pm
Posts: 856
Location: Canada
Okay, I've been able to fiddle with the camera a little bit and got it moving. But lighting continues to be a problem. Is there a way to disable it?

_________________
Locomotion Related:
Northern Ontario & Quebec


Top
   
PostPosted: Sat Apr 24, 2010 2:06 pm 
Offline
Chief Executive
Chief Executive

Joined: Sun Nov 20, 2005 12:10 pm
Posts: 675
Location: Australia; Melbourne
What you should do, is attach the light(sun, or lamp) to the camera...

_________________
Image


Top
   
PostPosted: Wed Jun 02, 2010 11:45 am 
Offline
Director
Director
User avatar

Joined: Thu May 08, 2008 7:01 am
Posts: 574
Location: /home/root
Has anybody ever tried making anything in Autodesk Inventor? (same makers as 3Ds max)

I was playing around with it earlier today. And maybe it's just because of my prior experience, but I've started picking it up much quicker than max (not that I've spent much time with either).

I'd like to make some basic Australian rolling stock at some stage when I get the chance (NSWGR/PN...). What I've got here is a quick WIP of a SRA NHFF coal hopper.

Attachment:
File comment: test render of a WIP NSWGR NHFF coal hopper
Image00.png
Image00.png [ 78.05 KiB | Viewed 4924 times ]

Not sure about texturing and stuff(if I can, but I'll be looking into it.) but there's always importing it into max from there...
Attachment:
File comment: render of NHFF WIP after MAX import
NHFF test render.png
NHFF test render.png [ 57.11 KiB | Viewed 4924 times ]

_________________
In exile until I have time to live again.

[WIP] (on hold) - QLD Narrow Gauge Set/Sugar Cane Plantation
[WIP/Beta] (on hold) - Sydney Cityrail Platforms
[WIP]NSW Rollingstock


Top
   
PostPosted: Thu Jun 10, 2010 9:37 am 
Offline
Engineer
Engineer
User avatar

Joined: Thu Feb 11, 2010 6:09 am
Posts: 62
Location: Middle America
Anybody using 3D Canvas (3DC)?

I downloaded a ton of free 3D modeling software and renderers a couple months ago. Snooped around in some of them, and settlled on 3DC for my first attempt since it had an interface that was intuitive (at least to me).

After working through the built-in tutorial, I thought I'd try an old timey (steam era) U.S. water tower for my first serious project. The pic below is where I'm at with it. The spout pivots too. But now I'm stuck. 3DC doesn't seem to have (or I can't find) any separate dialog boxes for the camera settings, so I can't set the angles properly. The pic is just a guesstimate of the proper angles using a mouse.

If anyone's used this program and can offer some advice I'd be grateful.

Thanks.


Attachments:
File comment: Goal was for a weathered look.
WT Snapshot 1.png
WT Snapshot 1.png [ 121.59 KiB | Viewed 4872 times ]

_________________
Corral those nutty peeps with a Boundary Fence
Replace wimpy steamer sounds with Steamer Sound Kit
Top
   
PostPosted: Sat Jun 12, 2010 6:36 am 
Offline
Transport Coordinator
Transport Coordinator

Joined: Sat Oct 03, 2009 9:30 am
Posts: 350
Let me post some of the tiny tools written by me for those who may want to use blender to make their objects. It can be used to generate the sprites for virtually all types of objects.

The first one is my tiny rendering script written in python. You can choose to simply copy & paste then run it in Text Window, but you are encouraged to copy the code into a .py file, place it into the script directory of Blender (Should be something like %APPDATA%\Roaming\Blender Foundation\Blender\.blender\scripts) then call it from the "Scripts" menu in Script Window.

Code:
#!BPY
""" Registration info for Blender menus:
Name: 'Auto renderer for Locomotion'
Blender: 237
Group: 'Render'
Tooltip: 'Generate sprites for Locomotion Objects'
"""

__author__ = "K.Y.Chung"
__url__ = ("blender", "kychung")
__version__ = "3.0"

__bpydoc__ = """\
This script can generate the sprites for Locomotion Objects. All Rights Reserved. The author disclaims all liabilities.
"""

from Blender import *
from Blender.BGL import *
from Blender.Draw import *
from Blender.Scene import Render
import math

# Events
EVENT_MENU_V = 1
EVENT_MENU_O = 4
EVENT_START = 2
EVENT_EXIT = 3

# Vehicle Type
vehType = Create(1)

# Object to rotate/orbit
targetObject = Create(1)

# Sprites for Railway Car Bogies
b1 = range ( 0, 16 ) # Sprite indexes for horizontal
b2 = range ( 16, 48 ) # Sprite indexes for 11.5 degree slopes

# Sprites for Railway Cars / Narrow Gauge Railway Cars / Ships / Aircrafts
i1 = range ( 0, 64 ) # Sprite indexes for horizontal
   
# Additional sprites for Railway Cars / Narrow Gauge Railway Cars / Aircrafts
i2 = range ( 64, 68 ) # Sprite indexes for 6 degree slope
i3 = range ( 68, 72 ) # Sprite indexes for -6 degree slopes
i4 = range ( 72, 104 ) # Sprite indexes for 11.5 degree slopes
i5 = range ( 104, 136 ) # Sprite indexes for -11.5 degree slopes

# Additional sprites for Narrow Gauge Railway Cars
i6 = range ( 136, 140 ) # Sprite indexes for 17 degree slopes
i7 = range ( 140, 144 ) # Sprite indexes for -17 degree slopes
i8 = range ( 144, 176 ) # Sprite indexes for 22.5 degree slopes
i9 = range ( 176, 208 ) # Sprite indexes for -22.5 degree slopes
   
# Sprites for Road Vehicles / Trams / Aircraft Shadows
j1 = range ( 0, 32 ) # Sprite indexes for horizontal
j2 = range ( 32, 36 ) # Sprite indexes for 6 degree slope
j3 = range ( 36, 40 ) # Sprite indexes for -6 degree slopes
j4 = range ( 40, 44 ) # Sprite indexes for 11.5 degree slopes
j5 = range ( 44, 48 ) # Sprite indexes for -11.5 degree slopes
j6 = range ( 48, 52 ) # Sprite indexes for 17 degree slopes
j7 = range ( 52, 56 ) # Sprite indexes for -17 degree slopes
j8 = range ( 56, 60 ) # Sprite indexes for 22.5 degree slopes
j9 = range ( 60, 64 ) # Sprite indexes for -22.5 degree slopes

# Sprites for Aircraft Shadows
k1 = range ( 136, 168 )
   
#Sprites for Buildings
k2 = range ( 0, 4 )

# GUI drawing
def draw():
   global vehType, targetObject
   global EVENT_MENU_V, EVENT_MENU_O, EVENT_START, EVENT_EXIT
   
   glClear(GL_COLOR_BUFFER_BIT)
   glColor3f(0,0,0)
   
   # Limitations and Precautions
   glRasterPos2d(10, 250)
   Text("Limitations and precautions: (READ CAREFULLY BEFORE START)")
   glRasterPos2d(10, 225)
   Text("1. All the render parameters and lights should be set manually before running this script. The script will do nothing about it.")
   glRasterPos2d(10, 210)
   Text("2. There should be ONE and NO MORE THAN ONE camera in the scene, which has been configured properly.")
   glRasterPos2d(10, 195)
   Text("3. The camera should be placed in the 2nd quadrant, pointing towards the origin.")
   glRasterPos2d(10, 180)
   Text("3. The vehicle itself should be a single mesh object, join all together if there is more than one.")
   glRasterPos2d(10, 165)
   Text("4. Check the orientation of the vehicle by switching to Front View first. The vehicle should head along y-axis towards -ve direction initially.")
   glRasterPos2d(10, 150)
   Text("4. The vehicle object should not be translated or rotated in \"Transform Properties\". Object scales should be the same in all directions.")
   glRasterPos2d(10, 135)
   Text("5. You need to \"tilt\" the \"car\" by yourself in Edit Mode if you are making tilt trains.")
   
   # Titles
   glRasterPos2d(10,290)
   Text("Generate sprites for Locomotion Objects", 'large')
   
   # Menu to choose vehicle type
   glColor3f(1,1,1)
   glRasterPos2d(10, 90)
   Text("Vehicle Type:")
   MenuOptions = "Railway Cars %x1|Railway Cars (Tilt Trains) %x9|Railway Cars (Tilt Trains banking left) %x10|Railway Cars (Tilt Trains banking right) %x11|Railway Car Bogies %x13|Narrow Gauge Railway Cars %x2|Road Vehicles %x3|Braking Lights of Road Vehicles %x4|Trams %x5|Ships %x6|Aircrafts %x7|Aircraft Shadows %x12|Buildings %x8"
   vehType = Menu(MenuOptions, 1, 150, 85, 220, 20, vehType.val, "Choose the Vehicle Type.")

   #Menu to choose the object to rotate/orbit
   glRasterPos2d(10, 50)
   Text("Object to rotate/orbit:")
   MenuTargetObject = "Mesh %x1|Camera %x2"
   targetObject = Menu(MenuTargetObject, 4, 150, 45, 220, 20, targetObject.val, "Choose the object to rotate/orbit.")
   
   # Start and Exit
   Button("Start", 2, 10, 10, 50, 18)
   Button("Exit", 3, 70, 10, 50, 18)

def event(evt, val):
   global vehType, targetObject
   global EVENT_MENU_V, EVENT_MENU_O
   
   if ((evt == QKEY) or (evt == ESCKEY)):
      Exit()
   elif (evt == EVENT_MENU_V):
      vehType == val
   elif (evt == EVENT_MENU_O):
      targetObject == val
   
def bevent(evt):
   global vehType, targetObject
   global EVENT_START, EVENT_EXIT
   
   # Manages GUI events
   if (evt == EVENT_EXIT):
      Exit()
   elif (evt == EVENT_START):
      main()

def autoRender(n):
   global vehType

   # Get the sprite index, shift or multiply for some vehicle types
   if (vehType == 3):
      n = n * 2
   if (vehType == 4):
      n = ( n * 2 ) + 1
   if (vehType == 9):
      n = n * 3
   if (vehType == 10):
      n = ( n * 3 ) + 1
   if (vehType == 11):
      n = ( n * 3 ) + 2
   k = str(n)
   while (len(k) < 3): # Fill leading zeros
      k = '0' + k

   # Execute rendering routine
   scene= Scene.GetCurrent()
   context = scene.getRenderingContext()

   context.render()
   context.saveRenderedImage(k)
   
def main():
   scn = Scene.GetCurrent()
   ob = scn.objects.active # Gets the current active object (If Any)
       
   if ob == None or ob.getType() != 'Mesh': # Checks the active objects a mesh
      Draw.PupMenu('ERROR%t|Select a mesh object.')
      return

   c = scn.objects.camera # Gets the active camera

   Window.WaitCursor(1) # So the user knowns the script is busy.

   is_editmode = Window.EditMode() # Store edit mode state
   if is_editmode: Window.EditMode(0) # Python must get a mesh in object mode.
   
   if (targetObject == 1):
      main_o(ob)
   elif (targetObject == 2):
      main_c(ob, c)
   
   # Go back into editmode if we started in edit mode.
   if is_editmode: Window.EditMode(1)
   Window.WaitCursor(0)

def main_c(ob, c):   
   global vehType
   global b1, b2, i1, i2, i3, i4, i5, i6, i7, i8, i9, j1, j2, j3, j4, j5, j6, j7, j8, j9, k1, k2
   
   #Get the initial pose of the camera
   c_LocXInit = c.LocX
   c_LocYInit = c.LocY
   c_RotZInit = c.RotZ
   c_modulus = math.hypot ( c_LocXInit, c_LocYInit )
   
   if (vehType == 13):
      for x in b1:
         c.RotZ = c_RotZInit + ( math.pi / 16 * ( x - b1[0] ) )
         c.LocX = c_modulus * math.cos ( c.RotZ - ( math.pi / 2 ) )
         c.LocY = c_modulus * math.sin ( c.RotZ - ( math.pi / 2 ) )
         autoRender(x)
      #Reset camera pose
      c.LocX = c_LocXInit
      c.LocY = c_LocYInit
      c.RotZ = c_RotZInit
      for x in b2:
         ob.RotX = - ( math.pi / 180 * 11.5 )
         c.RotZ = c_RotZInit + ( math.pi / 16 * ( x - b2[0] ) )
         c.LocX = c_modulus * math.cos ( c.RotZ - ( math.pi / 2 ) )
         c.LocY = c_modulus * math.sin ( c.RotZ - ( math.pi / 2 ) )
         autoRender(x)
      #Reset camera pose
      c.LocX = c_LocXInit
      c.LocY = c_LocYInit
      c.RotZ = c_RotZInit

   if ((vehType == 1) or (vehType == 2) or (vehType == 6) or (vehType == 7) or (vehType == 9) or (vehType == 10) or (vehType == 11)):
      for x in i1:
         c.RotZ = c_RotZInit + ( math.pi / 32 * ( x - i1[0] ) )
         c.LocX = c_modulus * math.cos ( c.RotZ - ( math.pi / 2 ) )
         c.LocY = c_modulus * math.sin ( c.RotZ - ( math.pi / 2 ) )
         autoRender(x)
      #Reset camera pose
      c.LocX = c_LocXInit
      c.LocY = c_LocYInit
      c.RotZ = c_RotZInit
   if ((vehType == 1) or (vehType == 2) or (vehType == 7) or (vehType == 9) or (vehType == 10) or (vehType == 11)):
      for x in i2:
         ob.RotX = - ( math.pi / 30 )
         c.RotZ = c_RotZInit + ( math.pi / 2 * ( x - i2[0] ) )
         c.LocX = c_modulus * math.cos ( c.RotZ - ( math.pi / 2 ) )
         c.LocY = c_modulus * math.sin ( c.RotZ - ( math.pi / 2 ) )
         autoRender(x)
      #Reset camera pose
      c.LocX = c_LocXInit
      c.LocY = c_LocYInit
      c.RotZ = c_RotZInit
      for x in i4:
         ob.RotX = - ( math.pi / 180 * 11.5 )
         c.RotZ = c_RotZInit + ( math.pi / 16 * ( x - i4[0] ) )
         c.LocX = c_modulus * math.cos ( c.RotZ - ( math.pi / 2 ) )
         c.LocY = c_modulus * math.sin ( c.RotZ - ( math.pi / 2 ) )
         autoRender(x)
      #Reset camera pose
      c.LocX = c_LocXInit
      c.LocY = c_LocYInit
      c.RotZ = c_RotZInit
   if ((vehType == 1) or (vehType == 2) or (vehType == 9) or (vehType == 10) or (vehType == 11)):
      for x in i3:
         ob.RotX = math.pi / 30
         c.RotZ = c_RotZInit + ( math.pi / 2 * ( x - i3[0] ) )
         c.LocX = c_modulus * math.cos ( c.RotZ - ( math.pi / 2 ) )
         c.LocY = c_modulus * math.sin ( c.RotZ - ( math.pi / 2 ) )
         autoRender(x)
      #Reset camera pose
      c.LocX = c_LocXInit
      c.LocY = c_LocYInit
      c.RotZ = c_RotZInit
      for x in i5:
         ob.RotX = math.pi / 180 * 11.5
         c.RotZ = c_RotZInit + ( math.pi / 16 * ( x - i5[0] ) )
         c.LocX = c_modulus * math.cos ( c.RotZ - ( math.pi / 2 ) )
         c.LocY = c_modulus * math.sin ( c.RotZ - ( math.pi / 2 ) )
         autoRender(x)
      #Reset camera pose
      c.LocX = c_LocXInit
      c.LocY = c_LocYInit
      c.RotZ = c_RotZInit
   if (vehType == 2):
      for x in i6:
         ob.RotX = - ( math.pi / 180 * 17 )
         c.RotZ = c_RotZInit + ( math.pi / 2 * ( x - i6[0] ) )
         c.LocX = c_modulus * math.cos ( c.RotZ - ( math.pi / 2 ) )
         c.LocY = c_modulus * math.sin ( c.RotZ - ( math.pi / 2 ) )
         autoRender(x)
      #Reset camera pose
      c.LocX = c_LocXInit
      c.LocY = c_LocYInit
      c.RotZ = c_RotZInit
      for x in i7:
         ob.RotX = math.pi / 180 * 17
         c.RotZ = c_RotZInit + ( math.pi / 2 * ( x - i7[0] ) )
         c.LocX = c_modulus * math.cos ( c.RotZ - ( math.pi / 2 ) )
         c.LocY = c_modulus * math.sin ( c.RotZ - ( math.pi / 2 ) )
         autoRender(x)
      #Reset camera pose
      c.LocX = c_LocXInit
      c.LocY = c_LocYInit
      c.RotZ = c_RotZInit
      for x in i8:
         ob.RotX = - ( math.pi / 180 * 22.5 )
         c.RotZ = c_RotZInit + ( math.pi / 16 * ( x - i8[0] ) )
         c.LocX = c_modulus * math.cos ( c.RotZ - ( math.pi / 2 ) )
         c.LocY = c_modulus * math.sin ( c.RotZ - ( math.pi / 2 ) )
         autoRender(x)
      #Reset camera pose
      c.LocX = c_LocXInit
      c.LocY = c_LocYInit
      c.RotZ = c_RotZInit
      for x in i9:
         ob.RotX = math.pi / 180 * 22.5
         c.RotZ = c_RotZInit + ( math.pi / 16 * ( x - i9[0] ) )
         c.LocX = c_modulus * math.cos ( c.RotZ - ( math.pi / 2 ) )
         c.LocY = c_modulus * math.sin ( c.RotZ - ( math.pi / 2 ) )
         autoRender(x)
      #Reset camera pose
      c.LocX = c_LocXInit
      c.LocY = c_LocYInit
      c.RotZ = c_RotZInit
   
   if ((vehType == 3) or (vehType == 4) or (vehType == 5)):
      for x in j1:
         c.RotZ = c_RotZInit + ( math.pi / 16 * ( x - j1[0] ) )
         c.LocX = c_modulus * math.cos ( c.RotZ - ( math.pi / 2 ) )
         c.LocY = c_modulus * math.sin ( c.RotZ - ( math.pi / 2 ) )
         autoRender(x)
      #Reset camera pose
      c.LocX = c_LocXInit
      c.LocY = c_LocYInit
      c.RotZ = c_RotZInit
      for x in j2:
         ob.RotX = - ( math.pi / 30 )
         c.RotZ = c_RotZInit + ( math.pi / 2 * ( x - j2[0] ) )
         c.LocX = c_modulus * math.cos ( c.RotZ - ( math.pi / 2 ) )
         c.LocY = c_modulus * math.sin ( c.RotZ - ( math.pi / 2 ) )
         autoRender(x)
      #Reset camera pose
      c.LocX = c_LocXInit
      c.LocY = c_LocYInit
      c.RotZ = c_RotZInit
      for x in j3:
         ob.RotX = math.pi / 30
         c.RotZ = c_RotZInit + ( math.pi / 2 * ( x - j3[0] ) )
         c.LocX = c_modulus * math.cos ( c.RotZ - ( math.pi / 2 ) )
         c.LocY = c_modulus * math.sin ( c.RotZ - ( math.pi / 2 ) )
         autoRender(x)
      #Reset camera pose
      c.LocX = c_LocXInit
      c.LocY = c_LocYInit
      c.RotZ = c_RotZInit
      for x in j4:
         ob.RotX = - ( math.pi / 180 * 11.5 )
         c.RotZ = c_RotZInit + ( math.pi / 2 * ( x - j4[0] ) )
         c.LocX = c_modulus * math.cos ( c.RotZ - ( math.pi / 2 ) )
         c.LocY = c_modulus * math.sin ( c.RotZ - ( math.pi / 2 ) )
         autoRender(x)
      #Reset camera pose
      c.LocX = c_LocXInit
      c.LocY = c_LocYInit
      c.RotZ = c_RotZInit
      for x in j5:
         ob.RotX = math.pi / 180 * 11.5
         c.RotZ = c_RotZInit + ( math.pi / 2 * ( x - j5[0] ) )
         c.LocX = c_modulus * math.cos ( c.RotZ - ( math.pi / 2 ) )
         c.LocY = c_modulus * math.sin ( c.RotZ - ( math.pi / 2 ) )
         autoRender(x)
      #Reset camera pose
      c.LocX = c_LocXInit
      c.LocY = c_LocYInit
      c.RotZ = c_RotZInit
      for x in j6:
         ob.RotX = - ( math.pi / 180 * 17 )
         c.RotZ = c_RotZInit + ( math.pi / 2 * ( x - j6[0] ) )
         c.LocX = c_modulus * math.cos ( c.RotZ - ( math.pi / 2 ) )
         c.LocY = c_modulus * math.sin ( c.RotZ - ( math.pi / 2 ) )
         autoRender(x)
      #Reset camera pose
      c.LocX = c_LocXInit
      c.LocY = c_LocYInit
      c.RotZ = c_RotZInit
      for x in j7:
         ob.RotX = math.pi / 180 * 17
         c.RotZ = c_RotZInit + ( math.pi / 2 * ( x - j7[0] ) )
         c.LocX = c_modulus * math.cos ( c.RotZ - ( math.pi / 2 ) )
         c.LocY = c_modulus * math.sin ( c.RotZ - ( math.pi / 2 ) )
         autoRender(x)
      #Reset camera pose
      c.LocX = c_LocXInit
      c.LocY = c_LocYInit
      c.RotZ = c_RotZInit
      for x in j8:
         ob.RotX = - ( math.pi / 180 * 22.5 )
         c.RotZ = c_RotZInit + ( math.pi / 2 * ( x - j8[0] ) )
         c.LocX = c_modulus * math.cos ( c.RotZ - ( math.pi / 2 ) )
         c.LocY = c_modulus * math.sin ( c.RotZ - ( math.pi / 2 ) )
         autoRender(x)
      #Reset camera pose
      c.LocX = c_LocXInit
      c.LocY = c_LocYInit
      c.RotZ = c_RotZInit
      for x in j9:
         ob.RotX = math.pi / 180 * 22.5
         c.RotZ = c_RotZInit + ( math.pi / 2 * ( x - j9[0] ) )
         c.LocX = c_modulus * math.cos ( c.RotZ - ( math.pi / 2 ) )
         c.LocY = c_modulus * math.sin ( c.RotZ - ( math.pi / 2 ) )
         autoRender(x)
      #Reset camera pose
      c.LocX = c_LocXInit
      c.LocY = c_LocYInit
      c.RotZ = c_RotZInit
   
   if (vehType == 12):
      for x in k1:
         c.RotZ = c_RotZInit + ( math.pi / 16 * ( x - k1[0] ) )
         c.LocX = c_modulus * math.cos ( c.RotZ - ( math.pi / 2 ) )
         c.LocY = c_modulus * math.sin ( c.RotZ - ( math.pi / 2 ) )
         autoRender(x)
      #Reset camera pose
      c.LocX = c_LocXInit
      c.LocY = c_LocYInit
      c.RotZ = c_RotZInit
      
   if (vehType == 8):
      for x in k2:
         c.RotZ = c_RotZInit + ( math.pi / 2 * ( x - k2[0] ) )
         c.LocX = c_modulus * math.cos ( c.RotZ - ( math.pi / 2 ) )
         c.LocY = c_modulus * math.sin ( c.RotZ - ( math.pi / 2 ) )
         autoRender(x)
      #Reset camera pose
      c.LocX = c_LocXInit
      c.LocY = c_LocYInit
      c.RotZ = c_RotZInit
      
   # Reset object orientations
   ob.RotX = 0
   
def main_o(ob):
   global vehType
   global b1, b2, i1, i2, i3, i4, i5, i6, i7, i8, i9, j1, j2, j3, j4, j5, j6, j7, j8, j9, k1, k2
   
   if (vehType == 13):
      for x in b1:
         ob.RotZ = - ( math.pi / 16 * ( x - b1[0] ) )
         autoRender(x)
      for x in b2:
         ob.RotX = - ( math.pi / 180 * 11.5 )
         ob.RotZ = - ( math.pi / 16 * ( x - b2[0] ) )
         autoRender(x)

   if ((vehType == 1) or (vehType == 2) or (vehType == 6) or (vehType == 7) or (vehType == 9) or (vehType == 10) or (vehType == 11)):
      for x in i1:
         ob.RotZ = - ( math.pi / 32 * ( x - i1[0] ) )
         autoRender(x)

   if ((vehType == 1) or (vehType == 2) or (vehType == 7) or (vehType == 9) or (vehType == 10) or (vehType == 11)):
      for x in i2:
         ob.RotX = - ( math.pi / 30 )
         ob.RotZ = - ( math.pi / 2 * ( x - i2[0] ) )
         autoRender(x)
      for x in i4:
         ob.RotX = - ( math.pi / 180 * 11.5 )
         ob.RotZ = - ( math.pi / 16 * ( x - i4[0] ) )
         autoRender(x)

   if ((vehType == 1) or (vehType == 2) or (vehType == 9) or (vehType == 10) or (vehType == 11)):
      for x in i3:
         ob.RotX = math.pi / 30
         ob.RotZ = - ( math.pi / 2 * ( x - i3[0] ) )
         autoRender(x)
      for x in i5:
         ob.RotX = math.pi / 180 * 11.5
         ob.RotZ = - ( math.pi / 16 * ( x - i5[0] ) )
         autoRender(x)

   if (vehType == 2):
      for x in i6:
         ob.RotX = - ( math.pi / 180 * 17 )
         ob.RotZ = - ( math.pi / 2 * ( x - i6[0] ) )
         autoRender(x)
      for x in i7:
         ob.RotX = math.pi / 180 * 17
         ob.RotZ = - ( math.pi / 2 * ( x - i7[0] ) )
         autoRender(x)
      for x in i8:
         ob.RotX = - ( math.pi / 180 * 22.5 )
         ob.RotZ = - ( math.pi / 16 * ( x - i8[0] ) )
         autoRender(x)
      for x in i9:
         ob.RotX = math.pi / 180 * 22.5
         ob.RotZ = - ( math.pi / 16 * ( x - i9[0] ) )
         autoRender(x)
   
   if ((vehType == 3) or (vehType == 4) or (vehType == 5)):
      for x in j1:
         ob.RotZ = - ( math.pi / 16 * ( x - j1[0] ) )
         autoRender(x)
      for x in j2:
         ob.RotX = - ( math.pi / 30 )
         ob.RotZ = - ( math.pi / 2 * ( x - j2[0] ) )
         autoRender(x)
      for x in j3:
         ob.RotX = math.pi / 30
         ob.RotZ = - ( math.pi / 2 * ( x - j3[0] ) )
         autoRender(x)
      for x in j4:
         ob.RotX = - ( math.pi / 180 * 11.5 )
         ob.RotZ = - ( math.pi / 2 * ( x - j4[0] ) )
         autoRender(x)
      for x in j5:
         ob.RotX = math.pi / 180 * 11.5
         ob.RotZ = - ( math.pi / 2 * ( x - j5[0] ) )
         autoRender(x)
      for x in j6:
         ob.RotX = - ( math.pi / 180 * 17 )
         ob.RotZ = - ( math.pi / 2 * ( x - j6[0] ) )
         autoRender(x)
      for x in j7:
         ob.RotX = math.pi / 180 * 17
         ob.RotZ = - ( math.pi / 2 * ( x - j7[0] ) )
         autoRender(x)
      for x in j8:
         ob.RotX = - ( math.pi / 180 * 22.5 )
         ob.RotZ = - ( math.pi / 2 * ( x - j8[0] ) )
         autoRender(x)
      for x in j9:
         ob.RotX = math.pi / 180 * 22.5
         ob.RotZ = - ( math.pi / 2 * ( x - j9[0] ) )
         autoRender(x)
   
   if (vehType == 12):
      for x in k1:
         ob.RotZ = - ( math.pi / 16 * ( x - k1[0] ) )
         autoRender(x)
      
   if (vehType == 8):
      for x in k2:
         ob.RotZ = - ( math.pi / 2 * ( x - k2[0] ) )
         autoRender(x)

   # Reset object orientations
   ob.RotX = 0
   ob.RotZ = 0
   
Register(draw, event, bevent)


The second one is a simple sprite entries generator for the xml config file written in javascript. Just edit the parameters using HTML editor or even notepad, then load it using any web browser you like. It will do one of the most tedious parts in the xml config file in less than a second. Personally I like to modify the xml directly rather than using vehicle creator.

Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
   <head>
      <meta http-equiv="Content-Type" content="text/html; charset=big5" />
      <title>Sprite entries Generator</title>
   </head>

   <body>
      <pre>
<script type="text/javascript" language="javascript">
//Parameters

var numsprites = 136; //Total number of sprite entries
var ioffset = 0; //Initial sprite index offset
var xofs = -110; //xofs
var yofs = -72; //yofs
var oname = "ROADBRT"; //Object Name
var stub = true; //Stubbed?

//Do not edit beyond this line

function PadDigits(n, totalDigits) {
   n = n.toString();
   while ( n.length < totalDigits ) {
      n = '0' + n;
   }
   return n;
}

for(i=0;i<numsprites;i++){
   document.write("   &lt\;sprite id=&quot\;"+(i+ioffset)+"&quot\; xofs=&quot\;"+xofs+"&quot\; yofs=&quot\;"+yofs+"&quot\;&gt\;<br />");
   document.write("      &lt\;bit name=&quot\;hasdata&quot\;&gt;1&lt\;/bit&gt\;<br />");
   document.write("      &lt\;bit name=&quot\;chunked&quot\;&gt\;0&lt\;/bit&gt\;<br />");
   document.write("      &lt\;bit name=&quot\;copy&quot\;&gt;0&lt\;/bit&gt\;<br />");
   if (stub) {
      document.write("      &lt\;stub&gt\;255&lt\;/stub&gt\;<br />");
   } else {
      document.write("      &lt\;pngfile&gt;"+oname+"\\\\"+PadDigits(i,3)+".png&lt\;/pngfile&gt\;<br />");
   }
   document.write("   &lt\;/sprite&gt\;<br />");
}
         </script>
      </pre>
   </body>
</html>


I hope all of you may find them useful.

_________________
Visit Nanyue Express for my railway car drawings


Last edited by K.Y.Chung on Fri Jan 14, 2011 2:51 pm, edited 7 times in total.

Top
   
PostPosted: Fri Jul 09, 2010 11:08 pm 
Offline
Engineer
Engineer
User avatar

Joined: Thu Dec 31, 2009 4:41 am
Posts: 43
Location: Southern California
:?:
This, my friends, is exactly where my problems lie when it comes to modelling. I absolutely have no idea where to start! Programs like Blender and 3DsMax are just plain difficult to understand. Any reccomendations on where I should start?


Top
   
PostPosted: Fri Jul 09, 2010 11:30 pm 
Offline
Chairman
Chairman
User avatar

Joined: Sat Mar 06, 2010 10:34 pm
Posts: 856
Location: Canada
Just start out very slowly with the programs that are difficult to understand. Just little things like a cube, and then try to get it into the game, and see what happens from there. Remember there are plenty tutorials on how to use them, via youtube etc.

_________________
Locomotion Related:
Northern Ontario & Quebec


Top
   
PostPosted: Sat Jul 10, 2010 4:44 am 
Offline
Engineer
Engineer
User avatar

Joined: Thu Dec 31, 2009 4:41 am
Posts: 43
Location: Southern California
Oh, boy! Tutorials on YouTube? Be sure to send me some links so I can see for myself!


Top
   
PostPosted: Sat Jul 10, 2010 8:44 am 
Offline
Tycoon
Tycoon
User avatar

Joined: Sun Sep 10, 2006 7:12 pm
Posts: 6989
Location: Adwick-Le-Street.
tngjstn wrote:
Oh, boy! Tutorials on YouTube? Be sure to send me some links so I can see for myself!

Or just find them yourself. Can't be that hard can it?

_________________
|||| My OTTD/TTDP pics ||||Currently slighty obsessed with getting Platinum Trophies||||Retired moderator||||


Top
   
PostPosted: Sat Jul 10, 2010 8:48 am 
Offline
Director
Director
User avatar

Joined: Thu May 08, 2008 7:01 am
Posts: 574
Location: /home/root
Badger wrote:
tngjstn wrote:
Oh, boy! Tutorials on YouTube? Be sure to send me some links so I can see for myself!

Or just find them yourself. Can't be that hard can it?

Someone should make a tutorial for that. And put it on youtube.

_________________
In exile until I have time to live again.

[WIP] (on hold) - QLD Narrow Gauge Set/Sugar Cane Plantation
[WIP/Beta] (on hold) - Sydney Cityrail Platforms
[WIP]NSW Rollingstock


Top
   
PostPosted: Sat Jul 10, 2010 10:06 pm 
Offline
Engineer
Engineer
User avatar

Joined: Thu Dec 31, 2009 4:41 am
Posts: 43
Location: Southern California
:idea: That is a brilliant idea! Youtube tutorials tend to be easier to follow, as locomotion is more of a visual strategy game.


Top
   
PostPosted: Sun Jul 11, 2010 11:07 am 
Offline
Transport Coordinator
Transport Coordinator

Joined: Sat Oct 03, 2009 9:30 am
Posts: 350
Let me post some old topics which is useful for newbies:

[Mini-Guide] - How to make a train for Locomotion
(A rendering script for Maya and a standard palette is included)

3D Studio template scene for creating new vehicles in Loco

I remember that there is a rendering script for 3dmax with a fancy UI, but I can't find it.

_________________
Visit Nanyue Express for my railway car drawings


Top
   
PostPosted: Sun Jul 11, 2010 12:11 pm 
Offline
Chief Executive
Chief Executive

Joined: Sun Nov 20, 2005 12:10 pm
Posts: 675
Location: Australia; Melbourne
Chung; I created a new .py file as stated, how ever I cant seem to find it in the scripts section; I use blender 2.49; and 2.5alpha2

also, I would like to know more about this script, does it mean we dont have to worry about moving the camera, we just have to make sure the object fills up the camera.
Or if possible, .rar up the code for us :P..

well anyways, yer, Phython cant seem to find it..

Anyways, hope all goes well people.

_________________
Image


Top
   
PostPosted: Sun Jul 11, 2010 2:26 pm 
Offline
Transport Coordinator
Transport Coordinator

Joined: Sat Oct 03, 2009 9:30 am
Posts: 350
The script can be found on "Scripts"->"Render" in the Scripts Window if it is being put to the correct place. In addition you can have a look on Wikibooks:
http://en.wikibooks.org/wiki/Blender_3D:_Noob_to_Pro/Advanced_Tutorials/Python_Scripting/Export_scripts

If you really can't make it right you can just simply copy & paste all the codes into the Text Editor Window and then choose "Text"->"Run Python Script", and it is what I did before when there is no UI foy my script.

All the things you need to make sure is to set your scene properly as stated in the documentation of the script itself. You can further verify just by pressing F12 to see whether you can get a proper render output as 000.png or not. The script will calculate the distance between the camera and the origin, then tell the camera to "walk around" the mesh object by 360*, while keeping the distance from origin constant.

There are 2 more screenshots FYI. I think just to have a try on it tells more than thousands of words. The worse case may just be getting 136 pieces of useless PNGs. :lol:


Attachments:
answer1.png
answer1.png [ 87.18 KiB | Viewed 4681 times ]
answer2.png
answer2.png [ 157.95 KiB | Viewed 4681 times ]

_________________
Visit Nanyue Express for my railway car drawings
Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 116 posts ]  Go to page Previous 1 2 3 4 5 6 Next

All times are UTC


Who is online

Users browsing this forum: No registered users and 3 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
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000-2018 phpBB Limited

Copyright © Owen Rudge/The Transport Tycoon Forums 2001-2018.
Hosted by Zernebok Hosting.