The origin of vastu shastra took place thousands of years ago. The learned men of those days may not have lived in houses themselves but they most definitely dedicated their lives to the development of the science "vastushastra" or "vastu", as it is popularly known today.
The principles of the science laid down during those days were based purely on the effect of sunrays during different times of the day. The observations and corrections made were noted and concluded only after in-depth screening of the situation.
Vastu is a part of Vedas. Through penance and meditation yogis of that period acquired answers that were believed to have come from the cosmic mind itself to their questions. Hence Vedas are heeded with divine knowledge. The art of Vastu originates in the Stapatya Veda, a part of the Atharva Veda.
Vastu was originally considered to be a purely technical subject and was confined to architects (Sthapatis) and handed over to their heirs. The principles of construction, architecture, sculpture etc., as enunciated in the epics and treatise on temple architecture, have been incorporated in the science of vastu.
The description of Vastu is present in epics like Mataysya Purana, Skanda Purana, Agni Purana, Garuda Purana, and Vishnu Purana. Ancient like Vishvakarma Prakash, Samraangan Sutradhar, Kashyap Shilpshastra, Vrihad Sanhita, and Praman Manjaree also pass over the knowledge of vastu shastra to the next generation.
It is mentioned in the Mahabharata that a number of houses were built for the kings who were invited to the city of Indraprastha for the Rajasuya Yagna of King Yuddhistira. Sage Vyasa says that these houses were as high as the peaks of Kailasa Mountains, The houses were free from obstructions, had compounds with high walls and their doors were of uniform height and inlaid with numerous metal ornaments. It is said that the site plan of Ayodhya, the city of Lord Rama was similar to the plan found in the great architectural text Manasara. References are also to be found in Buddhist literature, of buildings constructed on the basis of Vastu. They contain references to individual buildings. Lord Buddha is said to have delivered discourses on architecture and even told his disciples that supervising the construction of a building was one of the duties of the order. Mention is made of monasteries (Viharas) or temples, buildings which are partly residential and partly religious (Ardhayogas), residential storeyed buildings (Prasadas), multi-storeyed buildings (harmyas) and Guhas or residential buildings for middle class people.