Skip to main content

Posts

Adding 2D content to a WebGL context

Once you've successfully  created a WebGL context , you can start rendering into it. A simple thing we can do is draw a simple square untextured plane, so let's start there, by building code to draw a square plane. Drawing the scene The most important thing to understand before we get started is that even though we're only rendering a square plane object in this example, we're still drawing in 3D space. It's just we're drawing a square and we're putting it directly in front of the camera perpendicular to the view direction. We need to define the shaders that will create the color for our simple scene as well as draw our object. These will establish how the square plane appears on the screen. The shaders A  shader  is a program, written using the  OpenGL ES Shading Language  ( GLSL ), that takes information about the vertices that make up a shape and generates the data needed to render the pixels onto the screen: namely, the positions of the pixels and ...

landscape pictures

paragraph test

  屈原(前340年-前278年),戰國時期楚國人,羋姓,屈氏,名平,字原。屈原曾是楚国的高官,但为官并不得意,却有着很好的的文学功底,创作了《离骚》、《天问》、《九歌》、《九章》等著作。公元前278年,秦國太尉白起揮兵南下,攻破了郢都,屈原在绝望和悲巨愤之下怀大石投汨罗江而死。传說当地百姓投下粽子喂魚以此防止屈原遗体被鱼所食,後來逐漸形成一種儀式。以後每年的農历五月初五端午節,人們吃粽子,划龍舟以紀念這位偉大的詩人。   屈原用这样的方式来结束自己并没有改变楚国的命运,但却改变了两千多年后的人们的一种生活方式,端午节放假,包粽子,现代人用一种欢快的方式来纪念两千年前一个诗人的离去,在中国文化中多少感觉有些不同寻常的味道,当然很多人其实已经不太关心也不在乎端午节是怎么来的了,即使了解一些,过节嘛,总是要欢乐才行。清明都过的很欢乐,完全没有欲断魂的感觉,更何况端午呢。 我是个北方人,很北很北的北方人,我们那儿在端午节的时候没有龙舟可以划,甚至没有独木舟可以划,家附近只有一个不大的水库,划舟是不可能了。但我们也过端午节,过节的方式都是从上一辈传下来的。小的时候过端午并不放假,那时候还没有周末双休。 好处就是过端午的时候可以去学校显摆。那时候有这样几件事儿可做。   绑五彩线。一般是端午的前几天或者前一天,母亲拿出一个线筐来,里面有各种颜色的线和各种粗细的针,然后找出白、绿、黑、红、黄五种颜色,搓在一起,量量手腕的长度,一剪,然后系在手腕上。不只是女生绑五彩线,男生也绑,后来大了些,男生绑的就越来越少了。   采艾蒿。虽然我很那个地方很北很北,但是农历五月时,艾蒿也长起来了,印象中这个季节山里雾很大,时常的有雨。小学时,经常是几个同学约好第二天一起去采艾蒿,可真正起来的时候并不多,因为天亮的太早,很多同学三点多就起来了,采了艾蒿,白天几乎就没法上课了。 艾蒿采回来后,插在房檐下,家家如此。   碰鸡蛋。端午节也碰鸡蛋,每个同学都带个鸡蛋去学校,互相的碰,看谁的硬,最后才破,每个人有两次机会,鸡蛋的这头碰一次,那头碰一次。有的同学带的不是鸡蛋,而是鸭蛋,甚至鹅蛋来碰,还用手捂着,怕别人发现,当然最后他赢了,不过被发现后也没什么好结果,别人用拳头砸碎了他的鹅蛋。 这些事情似乎都发生在我初中以前,上了初中以后就少了,不知道是不是因为上了初中而不屑于玩这些略显幼稚的小游戏了。但有...

Flower from my one drive

insert image from gdrive

flowers