Exemplo n.º 1
0
import math3d
import gfx
import stage
import stage_util
import random

#def run():

misc_util = stage_util.CreateStageMiscUtility()

# floor
floor_pose = math3d.Matrix34(math3d.Vector3(0.0, -0.5, 0.0),
                             math3d.Matrix33Identity())
static_box = misc_util.CreateStaticBox(edge_lengths=math3d.Vector3(80, 1, 80),
                                       diffuse_color=gfx.Color(1, 1, 1, 1),
                                       pose=floor_pose)

for x in range(-1, 2):
    for z in range(-1, 2):
        if x == 0 and z == 0:
            continue

        box_pos = math3d.Vector3(x * 35.0, 2.0, z * 35.0)
        box_orient = math3d.Matrix33Identity()
        box_pose = math3d.Matrix34(box_pos, box_orient)
        misc_util.CreateBox(edge_lengths=math3d.Vector3(0.8, 0.8, 0.8),
                            diffuse_color=gfx.Color(1.0, 0.3, 0.3, 1.0),
                            pose=box_pose)

        box_pos = math3d.Vector3(x * 5.0, 2.0, z * 5.0)
        box_orient = math3d.Matrix33Identity()
Exemplo n.º 2
0
import math3d
import gfx
import stage
import stage_util
import random

# Initialize the basic random number generator
random.seed()

# Add a light
light_util = stage_util.CreateStageLightUtility()

dir_light = light_util.CreateHSDirectionalLightEntity(
    upper_color=gfx.Color(1.0, 1.0, 1.0, 1.0),
    lower_color=gfx.Color(0.1, 0.1, 0.1, 1.0),
    dir=math3d.Vector3(2, -3, 1))

#def run():

misc_util = stage_util.CreateStageMiscUtility()

misc_util.CreateSkybox()

# terrain
terrain_05 = misc_util.CreateStaticTriangleMeshFromMesh(
    mesh_path="models/terrain/compact_003_05.msh")
terrain_06 = misc_util.CreateStaticTriangleMeshFromMesh(
    mesh_path="models/terrain/compact_003_06.msh")
terrain_09 = misc_util.CreateStaticTriangleMeshFromMesh(
    mesh_path="models/terrain/compact_003_09.msh")
terrain_15 = misc_util.CreateStaticTriangleMeshFromMesh(
Exemplo n.º 3
0
import math3d
import gfx
import stage
import stage_util

#def run():

misc_util = stage_util.CreateStageMiscUtility()

misc_util.CreateSkybox()

misc_util.CreateStaticBox(edge_lengths=math3d.Vector3(200, 1, 200),
                          diffuse_color=gfx.Color(0.50, 0.45, 0.45, 1.0),
                          pose=math3d.Matrix34(math3d.Vector3(0.0, -0.5, 0.0),
                                               math3d.Matrix33Identity()))

for x in range(-2, 3):
    for y in range(-2, 3):
        for z in range(-2, 3):
            box_pos = math3d.Vector3(x, 100 + y, z)
            #box_orient = math3d.Matrix33Identity()
            box_orient = math3d.Matrix33RotationZ(
                x) * math3d.Matrix33RotationX(z)
            box_pose = math3d.Matrix34(box_pos, box_orient)
            misc_util.CreateBox(edge_lengths=math3d.Vector3(0.8, 0.8, 0.8),
                                diffuse_color=gfx.Color(1.0, 0.5, 0.5, 1.0),
                                pose=box_pose)

#return 1	# done - release the script

#ScriptBase.SetCallback( run )
Exemplo n.º 4
0
import math3d
import gfx
import stage
import stage_util

#def run():

misc_util = stage_util.CreateStageMiscUtility()

misc_util.CreateSkybox(
    texture_path="textures/skygrad-sunny_cloudless-s1x256.jpg")

for x in range(-2, 3):
    for y in range(-2, 3):
        for z in range(-2, 3):
            box_pos = math3d.Vector3(x, 100 + y, z)
            #box_orient = math3d.Matrix33Identity()
            box_orient = math3d.Matrix33RotationZ(
                x) * math3d.Matrix33RotationX(z)
            box_pose = math3d.Matrix34(box_pos, box_orient)
            misc_util.CreateBox(edge_lengths=math3d.Vector3(0.8, 0.8, 0.8),
                                diffuse_color=gfx.Color(1.0, 0.5, 0.5, 1.0),
                                pose=box_pose)

#return 1	# done - release the script

#ScriptBase.SetCallback( run )
Exemplo n.º 5
0
import math3d
import gfx
import stage
import stage_util

light_util = stage_util.CreateStageLightUtility()

dir_light = light_util.CreateHSDirectionalLightEntity( upper_color = gfx.Color(1.0, 1.0, 1.0, 1.0), lower_color = gfx.Color(0.1,0.1,0.1,1.0), dir = math3d.Vector3(2,-3,1) )
pnt_light = light_util.CreateHSPointLightEntity( upper_color = gfx.Color(1.00,0.86,0.51,1.0), lower_color = gfx.Color(0.1,0.1,0.1,1.0), pos = math3d.Vector3(0.0,3.5,8.0), attenu0=0.1, attenu1=0.1, attenu2=0.1 )
#dir_light = light_util.CreateHSDirectionalLightEntity( upper_color = gfx.Color(1.0,0.0,0.0,1.0), lower_color = gfx.Color(0.0,1.0,0.0,1.0), dir = math3d.Vector3(2,-3,1) )
Exemplo n.º 6
0
import math3d
import gfx
import stage
import stage_util


#def run():

misc_util = stage_util.CreateStageMiscUtility()

static_box = misc_util.CreateStaticBox( edge_lengths = math3d.Vector3(10,1,10), diffuse_color = gfx.Color(1,1,1,1), pose = math3d.Matrix34Identity() )

for i in range(3):
	box_pose = math3d.Matrix34( math3d.Vector3(-2,2,0) + math3d.Vector3(i*2,i,0), math3d.Matrix33Identity() );
	misc_util.CreateStaticBox( edge_lengths = math3d.Vector3(1,1,1), diffuse_color = gfx.Color(0.5,0.5,1.0,1.0), pose = box_pose )

#return 1	# done - release the script

#ScriptBase.SetCallback( run )
Exemplo n.º 7
0
import math3d
import gfx
import stage
import stage_util

misc_util = stage_util.CreateStageMiscUtility()

floor_pose = math3d.Matrix34(math3d.Vector3(0, -0.5, 0),
                             math3d.Matrix33Identity())
static_box = misc_util.CreateStaticBox(edge_lengths=math3d.Vector3(64, 1, 64),
                                       diffuse_color=gfx.Color(1, 1, 1, 1),
                                       pose=floor_pose)
misc_util.CreateStaticTriangleMeshFromMesh(
    mesh_path="models/Gerzi3DARTHouse.msh")

#return 1	# done - release the script

#ScriptBase.SetCallback( run )
Exemplo n.º 8
0
import visual_effect
import gfx

#render_mgr = visual_effect.GetEntityRenderManager()
#render_mgr.EnableSoftShadow()

effect_mgr = visual_effect.GetScreenEffectManager()
lf = effect_mgr.GetLensFlare()
lf.AddTexture(texture_path="textures/packed_lens_flare-4x1.dds",
              num_segs_x=4,
              num_segs_y=1)
lf.AddLensFlareRect(dim=0.09,
                    scale_factor=1.0,
                    dist_factor=0.70,
                    color=gfx.Color(1.000, 0.313, 0.188, 0.250),
                    tex_seg_index_x=0)
lf.AddLensFlareRect(dim=0.08,
                    scale_factor=1.0,
                    dist_factor=1.50,
                    color=gfx.Color(1.000, 0.813, 0.250, 0.130),
                    tex_seg_index_x=0)
lf.AddLensFlareRect(dim=0.07,
                    scale_factor=1.0,
                    dist_factor=0.47,
                    color=gfx.Color(0.938, 0.188, 0.360, 0.375),
                    tex_seg_index_x=0)
lf.AddLensFlareRect(dim=0.05,
                    scale_factor=1.0,
                    dist_factor=1.40,
                    color=gfx.Color(0.125, 0.250, 0.938, 0.125),
                    tex_seg_index_x=0)
Exemplo n.º 9
0
import math3d
import gfx
import stage
import stage_util


#def run():

misc_util = stage_util.CreateStageMiscUtility()

misc_util.CreateSkybox()

# floor
#static_box = misc_util.CreateStaticBox( edge_lengths = math3d.Vector3(50,1,50), diffuse_color = gfx.Color(1,1,1,1), pose = math3d.Matrix34Identity() )

for x in range(-2,3):
	for y in range(-2,3):
		for z in range(-2,3):
			box_pos = math3d.Vector3(x,100+y,z)
			#box_orient = math3d.Matrix33Identity()
			box_orient = math3d.Matrix33RotationZ(x) * math3d.Matrix33RotationX(z)
			box_pose = math3d.Matrix34( box_pos, box_orient )
			misc_util.CreateBox( edge_lengths = math3d.Vector3(0.8,0.8,0.8), diffuse_color = gfx.Color(1.0,0.5,0.5,1.0), pose = box_pose )

#return 1	# done - release the script

#ScriptBase.SetCallback( run )