Building's footprints node order

I want to implement 3D rendering of buildings.

I’ve seen that in OSM a building is described by a way with a “building” tag, and a series of nodes representing its footprint. Since I need to make a 3D mesh extruding the footprint, the order in which those nodes are stored is relevant.
I have 2 questions then:

1: Does OSM standard states anything about the order of the building’s footprint nodes? Can I assume they are always stored in a clockwise or anticlockwise order?
2: From what I can see from the data, a building seems to have always the first and the last node to be equal. Is that stated somewhere? Is it always like that or may happen that some footprints haven’t the first and last node coincidents and I eventually have to check explicitely for that?

Buildings in OpenStreetMap are mapped as areas with a building tag, so the usual conventions for areas in OpenStreetMap apply. They are explained here:

http://wiki.openstreetmap.org/wiki/Area

The most common representation of building areas is indeed a closed way, i.e. one where the first and last node are identical. It is not defined whether the nodes are in clockwise or anticlockwise order, you will find plenty examples of both. It may happen that some ways with building tags are not closed, which is generally a mapping error, so you will probably want to simply discard these.

As explained in the wiki, more complex buildings may be represented as a multipolygon relation composed of several ways (which may or may not be closed).