قُلْ إِنَّ صَلَاتِي وَنُسُكِي وَمَحْيَايَ وَمَمَاتِي لِلَّـهِ رَبِّ الْعَالَمِينَ - الأنعام: ١٦٢

Monday, November 23, 2009

بـــــــــــــــــــاء

السلام عليكم و رحمة الله و بركاته

قصة حقيقية نقلًا عن معلمة أختي

كنت في الحرم لأداء مناسك العمرة و لفت نظري امرأة كبيرة السن تقرأ القرآن و هي تبكي بكاءًا شديدًا. أكملت مناسكي و كانت المرأة لازالت تبكي. استغربت لحالها و قررت أن اسألها عن سر هذا الخشوع و البكاء.
ذهبت لأسألها فأخبرتني أن لها عدة أولاد كبار، تزوجوا و أنجبوا و انشغلوا بحياتهم...و أنها طلبت منهم أن يعلموها القراءة كي تقرأ كتاب الله
فكانوا دائمًا مشغولين عنها...استمرت بالإلحاح عليهم حتى تحرك ابنها الصغير و علمها حرف الباء 'ب'.
علمها كيف يرسم في اول الكلام و في وسطه و في آخره. و لم يكمل معها باقي الحروف...حاولت مرارًا معه أن يعلمها حرفًا آخر و لكنه كان دائمًا مشغولًا.
فعندما ذهبت للحرم و أرادت ان تقرأ القرآن...كانت تبحث عن الحرف الذي علمها إياه ابنها و تقول "باء" و استمرت هكذا و هي تبكي لأنها لا تفهم شيئًا مما تقول و تبكي على حالها!!

هذه المرأة تبكي لأنها تريد فهم كتاب الله و لا تستطيع...و نحن نعرف كيف نقرأ و نكتب و لكن...؟؟
هي تذكرة لحمد الله على نعمه...و تذكرة لتدبر آيات الله...و تذكرة لبر والدينا

قال تعالى: " طه ( 1 ) ما أنزلنا عليك القرآن لتشقى ( 2 ) إلا تذكرة لمن يخشى ( 3 )"

الحمد لله رب العالمين

Sunday, November 22, 2009

Dr Wayne Dyer - The Story of Teddy


The beautiful story of Teddy and Mrs Thompson, the Elementary School Teacher who was so affected by the life of one of her students; and how she too became such a positive influence on his life ...

Friday, November 6, 2009

لعله خيراً

Al Salam 3alikom w ra7mat Allah w'barakatoh

probably you've read this story before. It's just a reminder :)

لعله خيراً
كان لأحد الملوك وزير حكيم وكان الملك يقربه منه ويصطحبه معه في كل مكان. وكان كلما أصاب الملك ما يكدره قال له الوزير "لعله خيراً" فيهدأ الملك. وفي إحدى المرات قُطع إصبع الملك فقال الوزير "لعله خيراً" فغضب الملك غضباً شديداً وقال ما الخير في ذلك؟! وأمر بحبس الوزير
فقال الوزير الحكيم "لعله خيراً"، ومكث الوزير فترة طويلة في السجن. وفي يوم خرج الملك للصيد وابتعد عن الحراس ليتعقب فريسته، فمر على قوم يعبدون صنم فقبضوا عليه ليقدموه قرباناً للصنم ولكنهم تركوه بعد أن اكتشفوا أن قربانهم إصبعه مقطوع, فانطلق الملك فرحاً بعد أن أنقذه الله من الذبح تحت قدم تمثال لا ينفع ولا يضر وأول ما أمر به فور وصوله القصر أن أمر الحراس أن يأتوا بوزيره من السجن واعتذر له عما صنعه معه وقال أنه أدرك الآن الخير في قطع إصبعه، وحمد الله تعالى على ذلك
ولكنه سأله عندما أمرت بسجنك قلت "لعله خيراً" فما الخير في ذلك؟ فأجابه الوزير أنه لو لم يسجنه لصاحبه فى الصيد فكان سيُقدم قرباناً بدلاً من الملك... فكان في صنع الله كل الخير

:) فلعله خيراً

Monday, November 2, 2009

Contouring

Al salam 3alikom w ra7mat Allah w'barakatoh

These are my notes about our next assignment in visualization.

(Polygon Filling Algorithm)

1st we'll be using the loader to load the mesh we need to color. This mesh consists of polygons. We'll be coloring these polygons.

We'll make a function with the following specifications
Input:
  • The polygon to be colored
  • The contours that we did last week
Output:
  • An array of lines with their corresponding colors (we'll get them from the color map editor we did 2 weeks ago)
How will we color the regions of the polygon??

using the lines from the array we just got [L1 & L2]. We'll iterate on all the vertices we have in this polygon [V1, V2, V3 & V4] and check if the region we are coloring contains this vertex or not.
If it contains the vertex, then add the vertex to -say- an array of points that defines this region.
After we finish this iteration, we'll be having a set of points that defines the regions to be colored.

in this example we'll have 3 arrays:
[L1, V1] [L1, L2, V2, V4] [L2, V3]
These defines the 3 regions [R1, R2 & R3]
Now What?

can we start coloring?
No, we still need to sort these points, to be able to color the regions.
How will we sort them?
take any vertex as a reference point, then draw the main coordinates (wiz respect to this vertex) & calculate the angles between the main coordinates and the lines.
Sort the angles & start coloring.

Here we took V4 as a reference point.
The Orange lines represent the main axes.
and the angles are (1, 2 & 3)


(Texture Mapping)

This should be faster than the "polygon filling" algorithm and easier to implement.
say we have 8 colors. We'll store them as 8 pixels in the memory.
We should normalize the values, so that they range from 0 to 1.
Also the values of pixels in the polygon, should range from 0 to 1.
Now we'll iterate on the polygon's pixels and get the required pixel (color) directly from the memory.
No distribution is used. We get the color directly from the pixels we stored.


I hope you find this post useful :)
Al Salam 3alikom w ra7mat Allah w'barakatoh