Jump to content
  • Advertisement


Sign in to follow this  
  • entries
  • comments
  • views

In a rush

Sign in to follow this  


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.
[source lang = "python"]import map_interface

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

tex1 = t.load_texture(engine,".\\textures\\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(".\\textures\\sk5n.bmp", ".\\textures\\sk5n.bmp",
".\\textures\\sk4n.bmp", ".\\textures\\sk2n.bmp",
".\\textures\\sk1n.bmp", ".\\textures\\sk3n.bmp")

house = o.Load_Mesh(engine, ".\\models\\house 1\\house1.x")
house2 = o.Load_Mesh(engine, ".\\models\\house f\\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)

Sign in to follow this  

1 Comment

Recommended Comments

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!