SU (and Kerkythea) can render in parallel projection, which covers isometric and the special angle required for ttd/openttd. Setting the correct camera angle can be done with a script.
The newest beta of the Kerkythea exporter even correctly gets the setting from SU (Camera -> Parallel Projection), unfortunately it seems to interpret the distance wrong, so you end up zoomed in way too much (so far that at first I thought it was completely broken, but I just had to zoom out in K a lot .
El'Muppo, the alpha is exactly what I mean, but afaik you cannot set it for the background.
Only thing we now need is some XYZ coordinates in meters/inches for all the different camera positions. I know it's possible to export camera's in various formats. I don't know or it's possible to export multiple camera's in one file.
Attachments
cam.jpg (32.8 KiB) Viewed 8068 times
Last edited by trainboy2004 on 24 Feb 2009 16:17, edited 4 times in total.
nice!
Back last year I wanted to play with 32bpp graphics and was totally annoyed by the totally ugly 8bpp catenary. So I started playing around in Gimp. Anyway, those poles really look bad, though I do like the wires. These are so much better though.
Aligning the poles can be quite tricky (or it's just me...). I spent quite some time trying to get it all right. Feel free to use my work in any way you could use it, even if it's just for the aligning: http://www.tt-forums.net/viewtopic.php?p=709633#p709633
Btw, I used the Dutch Catenary GRF because I couldn't find the Sprite IDs for the catenary in the basic game.
There's still some things that should go into the script, like zooming the camera (doing that manually without loosing your lookat is nigh-impossible).
It's also a pity that the free SU version cannot render a transparent background, at least on Windows (the Mac version reportedly can, as can the Pro version with a work-around using layout). I think the Sketchup look might work well for 32bpp toyland.
What about right spot for the sun ?
I bet its loads of information about it in the forums but since its a big maze for me i just wanted to bring up that part, its able to put that stuff in the ruby aswell right?
Since earlier in the thread you were looking for the exact input values:
Directions for sketchup using the camera positioning script. Ignore everything about indexed 256 color if this is for only 32bit.
Set the model units to metric
Go to Camera->Toggle OFF perspective, this is important
Go to Camera->Target (an option added by the script) and set the position values as follows
20, -20, 16.3
The target should be the origin at 0,0,0
Focal angle doesn't matter
The produced images, with 3rd party textures are suitable for OTTD, or if you use color by layer /materials set to the TTD palette you can do TTDP buildings with some resizing, palette adjustment (photoshop works best to avoid dithering problems), and some recoloring to recover any lost details. If you want to avoid some of this, try setting your desktop to 256 index color depth in the control panel.
Location and setting the position of the sun is under the window->model info->location tab. Tick on show in model and select will allow you to set the angle of the sun direction wise while the geographic location will set the sun's height in the sky.
Almost forgot go into view->rendering and shut off profile edges
Then it is a personal preference for the appearence but also tick off display edges OR go into window->display settings and change edge color from All Same to By Material
Otherwise your image will have thick black lines around the corners and details when you shrink the exported images to fit TTD scale and go into TTDX indexed color.
Put this in a text file and save it as "camera_parameters.rb" to the scripts folder of sketchup.
# cameraparams.rb
# Version of 09/07/04
# Copyright 2004 Envision 3D Limited
# Set camera parameters in sketchup
require 'sketchup.rb'
# Set camera parameters using viewpoint and target
def camera_vp_targ
model = Sketchup.active_model
view = model.active_view
camera = view.camera
# Get camera viewpoint and target
eye = camera.eye
vx = eye.x
vy = eye.y
vz = eye.z
# fov property is VFOV not HFOV
vfovdeg = camera.fov
# Viewport size
w = Float(view.vpwidth)
h = Float(view.vpheight)
# Work out HFOV from VFOV and viewport size
vfovrad = vfovdeg*Math::PI/180.0
f = (h/2)/Math.tan(vfovrad/2.0)
hfovrad = 2.0*Math.atan2((w/2),f)
hfovdeg = hfovrad*180.0/Math::PI
# Read back new values
vx, vy, vz, tx, ty, tz, hfovdeg = results
# New viewpoint and target
eye.x = vx
eye.y = vy
eye.z = vz
target.x = tx
target.y = ty
target.z = tz
# Up vector is straight up
up = camera.up
up.set!(0.0, 0.0, 1.0)
# Set new parameters
camera.set eye, target, up
# Work out VFOV from HFOV and viewport size
hfovrad = hfovdeg*Math::PI/180.0
f = (w/2)/Math.tan(hfovrad/2.0)
vfovrad = 2.0*Math.atan2((h/2),f)
vfovdeg = vfovrad*180.0/Math::PI
# Apply to camera
camera.fov = vfovdeg
end
# Set camera parameters using viewpoint, azimuth and elevation
def camera_vp_az_el
model = Sketchup.active_model
view = model.active_view
camera = view.camera
# Get camera viewpoint and target
eye = camera.eye
vx = eye.x
vy = eye.y
vz = eye.z
# Work out azimuth and elevation angles
if vx == tx && vy == ty then
az = 0
if vz > tz then
el = -90.0
else
el = 90.0
end
else
az = Math.atan2(tx-vx,ty-vy)*180.0/Math::PI
if az < 0.0 then
az = az+360.0
end
el = Math.atan2((tz-vz),Math.sqrt((tx-vx)*(tx-vx)+(ty-vy)*(ty-vy)))*180.0/Math::PI
end
# fov property is VFOV not HFOV
vfovdeg = camera.fov
# Viewport size
w = Float(view.vpwidth)
h = Float(view.vpheight)
# Work out HFOV from VFOV and viewport size
vfovrad = vfovdeg*Math::PI/180.0
f = (h/2)/Math.tan(vfovrad/2.0)
hfovrad = 2.0*Math.atan2((w/2),f)
hfovdeg = hfovrad*180.0/Math::PI
# Dialogue box
prompts = ["Position X", "Position Y", "Position Z", "Azimuth", "Elevation", "Focal angle"]
values = [vx, vy, vz, az, el, hfovdeg]
results = inputbox prompts, values, "Camera point of view/ Target"
# Read back new values
vx, vy, vz, az, el, hfovdeg = results
# New viewpoint
eye.x = vx
eye.y = vy
eye.z = vz
# Work out the length of the viewpoint-target vector
# but use 10 metres if it's presently zero.
vdist = Math.sqrt((tx-vx)*(tx-vx)+(ty-vy)*(ty-vy)+(tz-vz)*(tz-vz))
if vdist == 0.0 then
vdist = 10.0
end
# Special case if elevation is straight up or down.
if el >= 89.9 then
tx = vx
ty = vy
tz = vz+vdist
elsif el <= -89.9 then
tx = vx
ty = vy
tz = vz-vdist
# Otherwise calculate new target from azimuth and elevation.
else
vectx = Math.sin(az*Math::PI/180.0)
vecty = Math.cos(az*Math::PI/180.0)
vectz = Math.sqrt(vectx*vectx+vecty*vecty)*Math.tan(el*Math::PI/180.0)
veclen = Math.sqrt(vectx*vectx+vecty*vecty+vectz*vectz)
tx = vx+vectx*vdist/veclen
ty = vy+vecty*vdist/veclen
tz = vz+vectz*vdist/veclen
end
# New target position
target.x = tx
target.y = ty
target.z = tz
# Up vector is straight up
up = camera.up
up.set!(0.0, 0.0, 1.0)
# Set new parameters
camera.set eye, target, up
# Work out VFOV from HFOV and viewport size
hfovrad = hfovdeg*Math::PI/180.0
f = (w/2)/Math.tan(hfovrad/2.0)
vfovrad = 2.0*Math.atan2((h/2),f)
vfovdeg = vfovrad*180.0/Math::PI
# Apply to camera
camera.fov = vfovdeg
end
# Put menu items for script on end of Camera menu
if( not file_loaded?("camera_parameters.rb") )
add_separator_to_menu("Camera")
UI.menu("Camera").add_item("Camera / Target") { camera_vp_targ }
UI.menu("Camera").add_item("Camera / Azimuth / Elevation") { camera_vp_az_el }
end
Taking someone's artwork from an online 3D library and rendering it with our camera settings does not mean you've reduced the time it takes to create OTTD graphics to 1 minute.
If the source was GPL compatible, then maybe it could be adapted for our uses.
Jupix wrote:Taking someone's artwork from an online 3D library and rendering it with our camera settings does not mean you've reduced the time it takes to create OTTD graphics to 1 minute.
If the source was GPL compatible, then maybe it could be adapted for our uses.
Hehe. Especially as the shown airbus has a right wing which is about 1.5 times the length of the left wing
planetmaker wrote:.. has a right wing which is about 1.5 times the length of the left wing
- parallel projections (this settings are in ruby plugin). About copyrights and etc - i mean only development time, nothing else, sketchup can improve it.