Jump to content

  • Log In with Google      Sign In   
  • Create Account


TankBo

Member Since 04 Nov 2009
Offline Last Active Aug 12 2013 02:29 PM
-----

Topics I've Started

Pass std::map iterators to Lua with Luabind

25 July 2011 - 02:40 AM

Hi guys,

does anyone know if it's possible to pass std::map iterators to Lua using Luabind?

I know that Luabind supports the return_stl_iterator policy, and it just works fine for non-associative containers like std::vector and std::list. However, having an iterator with "first" and "second" members, Luabind isn't able to export them, thus getting "class not registered" errors (because Luabind dereferences the iterator when using the policy, which leads to the wanted type in non-associative containers, but to a std::pair for associative containers).

Greetings.

Using 3D boxes for isometric view

04 November 2009 - 09:44 PM

Hi guys, I've been developing an isometric engine for about 3 weeks now and I'm really getting mad. It's a 2D engine with software z-ordering -- I guess you know what that mean: Restrictions, restrictions, hacks, cheats, and restrictions. :( Then I found a thread by O-san (http://www.gamedev.net/community/forums/topic.asp?topic_id=447054&whichpage=1) showing his isometric engine using real 3D boxes with texture coordinates mapped to the camera -- awesome! I like his approach and definitely want to switch mine. So how does that work in detail? Do you - create cubes and then rotate the view? - create already rotated cubes (by using appropriate vertex coordinates) and just rotate the camera 60° down the x-axis? My first attempt was the second one. This way it's easy to get the right box size, but I still have the typical isometric coordinates which I actually wanted to get rid of (means: x, y get translated to x - y, x + y). Another question that came into my mind is: How do I correctly calculate the needed size of a cube? If, for example, a sprite is 64 * 64 pixels (where the grid size of my maps is 64 * 32 pixels), how do I calculate the proper cube dimensions? Would be nice to get some hints. I've searched the whole forums back to 2004 but couldn't find something that answers my questions. ;)

PARTNERS