Skip to main content
Reupload images to reliable stack.imgur; see http://meta.stackexchange.com/q/263771
Source Link
Vaillancourt
  • 16.4k
  • 17
  • 55
  • 61

I am trying to render some 3D model in blender and use them as a texture sprite in a game which uses Apple’s SpriteKit. I have an isometric map with tiles size : 32 as width and 24 as height, Since I use same size tile whole over the map (isometric) I need to use an orthographicsorthographic projection I think! please tell me if I am wrong but I was pretty sure! anyway…anyway...

I am using Blender to render my sprites (3D models) but I can not set the camera direction to have the rendered image really fit with the map. The attached picture shows the problem, take a look at the building.

I have also attached the geometric math that I have used to create my render script in Blender.

I found out that if I use a 32,24 tile I need to look at from 29Deg 29Min 28Sec but it seems not alright as the iOS simulator shows!

Can anyone help me on this? How do I have to prepare my sprite to fit well on my isometric map?

Those who have experianceexperience with isometric map games are welcome to answer and I really appreciate it.

hereHere is the code I wrote in python to render the 3D Model, I have also set the camera to Orthographic manually.

Isometric MapIsometric Map

MathMath

import bpy
cam = bpy.data.objects["Camera"]
def look_at(cam, point):
    loc_camera = cam.matrix_world.to_translation()
    direction = point - loc_camera
    # point the cameras '-Z' and use its 'Y' as up
    rot_quat = direction.to_track_quat('-Z', 'Y')
    # assume we're using euler rotation
    cam.rotation_euler = rot_quat.to_euler()
meshObj = bpy.data.objects["plate"]
meshObj.rotation_mode = 'XYZ'
#meshObj.rotation_euler = (0,0,0)
d = meshObj.dimensions
# Finding maximum dim of the object
objectScale = 1
if d[1] >= d[2]:
    objectScale = d[1] / 16
elif d[2] >= d[1]:
    objectScale = d[2] / 16
cam.rotation_mode = 'XYZ'
cam.location = (20.416*objectScale,20.416*objectScale,20.416*objectScale)
#cam.rotation_euler = (0.7853,0.7853,0.5147)
cam.rotation_euler = (0.7853,0.7853,0)
look_at(cam, meshObj.matrix_world.to_translation())
alamp = bpy.data.objects["Lamp"]
alamp.location = (17.416*objectScale/4,17.416*objectScale/4,20*objectScale/4)
print("Scaling ",objectScale)
bpy.context.scene.render.filepath = "/Users/iman/Documents/Render/ISOBUILDING.png"  
bpy.ops.render.render(write_still=True, use_viewport=True, scene="Camera”)

Thanks

Iman

I am trying to render some 3D model in blender and use them as a texture sprite in a game which uses Apple’s SpriteKit. I have an isometric map with tiles size : 32 as width and 24 as height, Since I use same size tile whole over the map (isometric) I need to use an orthographics projection I think! please tell me if I am wrong but I was pretty sure! anyway….

I am using Blender to render my sprites (3D models) but I can not set the camera direction to have the rendered image really fit with the map. The attached picture shows the problem, take a look at the building.

I have also attached the geometric math that I have used to create my render script in Blender.

I found out that if I use a 32,24 tile I need to look at from 29Deg 29Min 28Sec but it seems not alright as the iOS simulator shows!

Can anyone help me on this? How do I have to prepare my sprite to fit well on my isometric map?

Those who have experiance with isometric map games are welcome to answer and I really appreciate it.

here is the code I wrote in python to render the 3D Model, I have also set the camera to Orthographic manually.

Isometric Map

Math

import bpy
cam = bpy.data.objects["Camera"]
def look_at(cam, point):
    loc_camera = cam.matrix_world.to_translation()
    direction = point - loc_camera
    # point the cameras '-Z' and use its 'Y' as up
    rot_quat = direction.to_track_quat('-Z', 'Y')
    # assume we're using euler rotation
    cam.rotation_euler = rot_quat.to_euler()
meshObj = bpy.data.objects["plate"]
meshObj.rotation_mode = 'XYZ'
#meshObj.rotation_euler = (0,0,0)
d = meshObj.dimensions
# Finding maximum dim of the object
objectScale = 1
if d[1] >= d[2]:
    objectScale = d[1] / 16
elif d[2] >= d[1]:
    objectScale = d[2] / 16
cam.rotation_mode = 'XYZ'
cam.location = (20.416*objectScale,20.416*objectScale,20.416*objectScale)
#cam.rotation_euler = (0.7853,0.7853,0.5147)
cam.rotation_euler = (0.7853,0.7853,0)
look_at(cam, meshObj.matrix_world.to_translation())
alamp = bpy.data.objects["Lamp"]
alamp.location = (17.416*objectScale/4,17.416*objectScale/4,20*objectScale/4)
print("Scaling ",objectScale)
bpy.context.scene.render.filepath = "/Users/iman/Documents/Render/ISOBUILDING.png"  
bpy.ops.render.render(write_still=True, use_viewport=True, scene="Camera”)

Thanks

Iman

I am trying to render some 3D model in blender and use them as a texture sprite in a game which uses Apple’s SpriteKit. I have an isometric map with tiles size : 32 as width and 24 as height, Since I use same size tile whole over the map (isometric) I need to use an orthographic projection I think! please tell me if I am wrong but I was pretty sure! anyway...

I am using Blender to render my sprites (3D models) but I can not set the camera direction to have the rendered image really fit with the map. The attached picture shows the problem, take a look at the building.

I have also attached the geometric math that I have used to create my render script in Blender.

I found out that if I use a 32,24 tile I need to look at from 29Deg 29Min 28Sec but it seems not alright as the iOS simulator shows!

Can anyone help me on this? How do I have to prepare my sprite to fit well on my isometric map?

Those who have experience with isometric map games are welcome to answer and I really appreciate it.

Here is the code I wrote in python to render the 3D Model, I have also set the camera to Orthographic manually.

Isometric Map

Math

import bpy
cam = bpy.data.objects["Camera"]
def look_at(cam, point):
    loc_camera = cam.matrix_world.to_translation()
    direction = point - loc_camera
    # point the cameras '-Z' and use its 'Y' as up
    rot_quat = direction.to_track_quat('-Z', 'Y')
    # assume we're using euler rotation
    cam.rotation_euler = rot_quat.to_euler()
meshObj = bpy.data.objects["plate"]
meshObj.rotation_mode = 'XYZ'
#meshObj.rotation_euler = (0,0,0)
d = meshObj.dimensions
# Finding maximum dim of the object
objectScale = 1
if d[1] >= d[2]:
    objectScale = d[1] / 16
elif d[2] >= d[1]:
    objectScale = d[2] / 16
cam.rotation_mode = 'XYZ'
cam.location = (20.416*objectScale,20.416*objectScale,20.416*objectScale)
#cam.rotation_euler = (0.7853,0.7853,0.5147)
cam.rotation_euler = (0.7853,0.7853,0)
look_at(cam, meshObj.matrix_world.to_translation())
alamp = bpy.data.objects["Lamp"]
alamp.location = (17.416*objectScale/4,17.416*objectScale/4,20*objectScale/4)
print("Scaling ",objectScale)
bpy.context.scene.render.filepath = "/Users/iman/Documents/Render/ISOBUILDING.png"  
bpy.ops.render.render(write_still=True, use_viewport=True, scene="Camera”)
added 70 characters in body
Source Link

I am trying to render some 3D model in blender and use them as a texture sprite in a game which uses Apple’s SpriteKit. I have an isometric map with tiles size : 32 as width and 24 as height, Since I use same size tile whole over the map (isometric) I need to use an orthographics projection I think! please tell me if I am wrong but I was pretty sure! anyway….

I am using Blender to render my sprites (3D models) but I can not set the camera direction to have the rendered image really fit with the map. The attached picture shows the problem, take a look at the building.

I have also attached the geometric math that I have used to create my render script in Blender.

I found out that if I use a 32,24 tile I need to look at from 29Deg 29Min 28Sec but it seems not alright as the iOS simulator shows!

Can anyone help me on this? How do I have to prepare my sprite to fit well on my isometric map?

Those who have experiance with isometric map games are welcome to answer and I really appreciate it.

here is the code I wrote in python to render the 3D Model, I have also set the camera to Orthographic manually.

Isometric Map http://imgur.com/mxr32l4Isometric Map

Math http://imgur.com/o8yel2wMath

import bpy
cam = bpy.data.objects["Camera"]
def look_at(cam, point):
    loc_camera = cam.matrix_world.to_translation()
    direction = point - loc_camera
    # point the cameras '-Z' and use its 'Y' as up
    rot_quat = direction.to_track_quat('-Z', 'Y')
    # assume we're using euler rotation
    cam.rotation_euler = rot_quat.to_euler()
meshObj = bpy.data.objects["plate"]
meshObj.rotation_mode = 'XYZ'
#meshObj.rotation_euler = (0,0,0)
d = meshObj.dimensions
# Finding maximum dim of the object
objectScale = 1
if d[1] >= d[2]:
    objectScale = d[1] / 16
elif d[2] >= d[1]:
    objectScale = d[2] / 16
cam.rotation_mode = 'XYZ'
cam.location = (20.416*objectScale,20.416*objectScale,20.416*objectScale)
#cam.rotation_euler = (0.7853,0.7853,0.5147)
cam.rotation_euler = (0.7853,0.7853,0)
look_at(cam, meshObj.matrix_world.to_translation())
alamp = bpy.data.objects["Lamp"]
alamp.location = (17.416*objectScale/4,17.416*objectScale/4,20*objectScale/4)
print("Scaling ",objectScale)
bpy.context.scene.render.filepath = "/Users/iman/Documents/Render/ISOBUILDING.png"  
bpy.ops.render.render(write_still=True, use_viewport=True, scene="Camera”)

Thanks

Iman

I am trying to render some 3D model in blender and use them as a texture sprite in a game which uses Apple’s SpriteKit. I have an isometric map with tiles size : 32 as width and 24 as height, Since I use same size tile whole over the map (isometric) I need to use an orthographics projection I think! please tell me if I am wrong but I was pretty sure! anyway….

I am using Blender to render my sprites (3D models) but I can not set the camera direction to have the rendered image really fit with the map. The attached picture shows the problem, take a look at the building.

I have also attached the geometric math that I have used to create my render script in Blender.

I found out that if I use a 32,24 tile I need to look at from 29Deg 29Min 28Sec but it seems not alright as the iOS simulator shows!

Can anyone help me on this? How do I have to prepare my sprite to fit well on my isometric map?

Those who have experiance with isometric map games are welcome to answer and I really appreciate it.

here is the code I wrote in python to render the 3D Model, I have also set the camera to Orthographic manually.

Isometric Map http://imgur.com/mxr32l4

Math http://imgur.com/o8yel2w

import bpy
cam = bpy.data.objects["Camera"]
def look_at(cam, point):
    loc_camera = cam.matrix_world.to_translation()
    direction = point - loc_camera
    # point the cameras '-Z' and use its 'Y' as up
    rot_quat = direction.to_track_quat('-Z', 'Y')
    # assume we're using euler rotation
    cam.rotation_euler = rot_quat.to_euler()
meshObj = bpy.data.objects["plate"]
meshObj.rotation_mode = 'XYZ'
#meshObj.rotation_euler = (0,0,0)
d = meshObj.dimensions
# Finding maximum dim of the object
objectScale = 1
if d[1] >= d[2]:
    objectScale = d[1] / 16
elif d[2] >= d[1]:
    objectScale = d[2] / 16
cam.rotation_mode = 'XYZ'
cam.location = (20.416*objectScale,20.416*objectScale,20.416*objectScale)
#cam.rotation_euler = (0.7853,0.7853,0.5147)
cam.rotation_euler = (0.7853,0.7853,0)
look_at(cam, meshObj.matrix_world.to_translation())
alamp = bpy.data.objects["Lamp"]
alamp.location = (17.416*objectScale/4,17.416*objectScale/4,20*objectScale/4)
print("Scaling ",objectScale)
bpy.context.scene.render.filepath = "/Users/iman/Documents/Render/ISOBUILDING.png"  
bpy.ops.render.render(write_still=True, use_viewport=True, scene="Camera”)

Thanks

Iman

I am trying to render some 3D model in blender and use them as a texture sprite in a game which uses Apple’s SpriteKit. I have an isometric map with tiles size : 32 as width and 24 as height, Since I use same size tile whole over the map (isometric) I need to use an orthographics projection I think! please tell me if I am wrong but I was pretty sure! anyway….

I am using Blender to render my sprites (3D models) but I can not set the camera direction to have the rendered image really fit with the map. The attached picture shows the problem, take a look at the building.

I have also attached the geometric math that I have used to create my render script in Blender.

I found out that if I use a 32,24 tile I need to look at from 29Deg 29Min 28Sec but it seems not alright as the iOS simulator shows!

Can anyone help me on this? How do I have to prepare my sprite to fit well on my isometric map?

Those who have experiance with isometric map games are welcome to answer and I really appreciate it.

here is the code I wrote in python to render the 3D Model, I have also set the camera to Orthographic manually.

Isometric Map

Math

import bpy
cam = bpy.data.objects["Camera"]
def look_at(cam, point):
    loc_camera = cam.matrix_world.to_translation()
    direction = point - loc_camera
    # point the cameras '-Z' and use its 'Y' as up
    rot_quat = direction.to_track_quat('-Z', 'Y')
    # assume we're using euler rotation
    cam.rotation_euler = rot_quat.to_euler()
meshObj = bpy.data.objects["plate"]
meshObj.rotation_mode = 'XYZ'
#meshObj.rotation_euler = (0,0,0)
d = meshObj.dimensions
# Finding maximum dim of the object
objectScale = 1
if d[1] >= d[2]:
    objectScale = d[1] / 16
elif d[2] >= d[1]:
    objectScale = d[2] / 16
cam.rotation_mode = 'XYZ'
cam.location = (20.416*objectScale,20.416*objectScale,20.416*objectScale)
#cam.rotation_euler = (0.7853,0.7853,0.5147)
cam.rotation_euler = (0.7853,0.7853,0)
look_at(cam, meshObj.matrix_world.to_translation())
alamp = bpy.data.objects["Lamp"]
alamp.location = (17.416*objectScale/4,17.416*objectScale/4,20*objectScale/4)
print("Scaling ",objectScale)
bpy.context.scene.render.filepath = "/Users/iman/Documents/Render/ISOBUILDING.png"  
bpy.ops.render.render(write_still=True, use_viewport=True, scene="Camera”)

Thanks

Iman

Source Link

How should I set camera in Blender for example to render a sprite which can be used in an isometric map?

I am trying to render some 3D model in blender and use them as a texture sprite in a game which uses Apple’s SpriteKit. I have an isometric map with tiles size : 32 as width and 24 as height, Since I use same size tile whole over the map (isometric) I need to use an orthographics projection I think! please tell me if I am wrong but I was pretty sure! anyway….

I am using Blender to render my sprites (3D models) but I can not set the camera direction to have the rendered image really fit with the map. The attached picture shows the problem, take a look at the building.

I have also attached the geometric math that I have used to create my render script in Blender.

I found out that if I use a 32,24 tile I need to look at from 29Deg 29Min 28Sec but it seems not alright as the iOS simulator shows!

Can anyone help me on this? How do I have to prepare my sprite to fit well on my isometric map?

Those who have experiance with isometric map games are welcome to answer and I really appreciate it.

here is the code I wrote in python to render the 3D Model, I have also set the camera to Orthographic manually.

Isometric Map http://imgur.com/mxr32l4

Math http://imgur.com/o8yel2w

import bpy
cam = bpy.data.objects["Camera"]
def look_at(cam, point):
    loc_camera = cam.matrix_world.to_translation()
    direction = point - loc_camera
    # point the cameras '-Z' and use its 'Y' as up
    rot_quat = direction.to_track_quat('-Z', 'Y')
    # assume we're using euler rotation
    cam.rotation_euler = rot_quat.to_euler()
meshObj = bpy.data.objects["plate"]
meshObj.rotation_mode = 'XYZ'
#meshObj.rotation_euler = (0,0,0)
d = meshObj.dimensions
# Finding maximum dim of the object
objectScale = 1
if d[1] >= d[2]:
    objectScale = d[1] / 16
elif d[2] >= d[1]:
    objectScale = d[2] / 16
cam.rotation_mode = 'XYZ'
cam.location = (20.416*objectScale,20.416*objectScale,20.416*objectScale)
#cam.rotation_euler = (0.7853,0.7853,0.5147)
cam.rotation_euler = (0.7853,0.7853,0)
look_at(cam, meshObj.matrix_world.to_translation())
alamp = bpy.data.objects["Lamp"]
alamp.location = (17.416*objectScale/4,17.416*objectScale/4,20*objectScale/4)
print("Scaling ",objectScale)
bpy.context.scene.render.filepath = "/Users/iman/Documents/Render/ISOBUILDING.png"  
bpy.ops.render.render(write_still=True, use_viewport=True, scene="Camera”)

Thanks

Iman