More on the Script

9 05 2006

Not so much progress as I been spending a bit of time at dance practice. Nonetheless, Ive got basic random town creation. At the moment its very basic, you give a radius, center,number and disc thickness and it populates the scene with the selected model, filling the disc or if you chose rectangular the border the thickness limits it to. Right now stuff is being place on top of each other, I want to turn it off for some buildings as it dont look too good.

Im thinking that for each object being placed send a ray from its position and see if it intersects or picks some triangle in the scene, if so then check if the bounding volume of the picked object intersects its own. If intersection is not allowed then the building will not be placed.

import map_interface
t = map_interface.terrain()
o = map_interface.objs()

tex1 = t.load_texture(engine,"Stone_Sample_002.JPG")
plane = t.Create_Terrain_with_plane(engine, width = 3000,
                             height = 3000)

plane_node = t.Add_Terrain_to_scene(engine, plane, tex1)
engine.terrain.Add_Sky_Box("sk5n.bmp", "sk5n.bmp",
                   "sk4n.bmp", "sk2n.bmp",
                   "sk1n.bmp", "sk3n.bmp")

house = o.Load_Mesh(engine, "house1.x")
house2 = o.Load_Mesh(engine, "fachwerk12_LOWPOLY_TS.3ds")

o.Add_Animated_Entity(engine, handle = house)

engine.entities.Populate_Scene_with_object(house,5,
    1500,1500,40)

engine.entities.Populate_Scene_with_object(house2,20,
     1500,1500,0.4)

scr5.JPG scr7.JPG

Advertisements

Actions

Information

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s




%d bloggers like this: