2013年6月26日 星期三

Javascript cookie

   function SetCookie(name,value){
                        var NameString = name + "=" + value;
                                document.cookie = NameString;
                        }

    function GetCookie(name) {
                        var arr = document.cookie.match(new RegExp("(^| )"+name+"=([^;]*)(;|$)"));
                        if(arr != null) return unescape(arr[2]); return null;
                        }

2013年6月9日 星期日

導覽列如何加入圖片

css樣式標連結用class .feed
.navi li ul li .feed{
display:block;
height:50px;
width:50px;
background:url("img/apple.png") left no-repeat;
}


ul class標籤用feed代表
<ul class="feed"><li><a herf="#">餵食</a></li></ul></li>





2013年6月6日 星期四

物件位置更新

先宣告一個Object3D 物件
var myfish=THREE.Object3D;

...

loader=...

myfish=object;   //object是blender obj mtl load進來的物件
...

update(){
      myfish.translateX=10;          平移10個單位
}


在要呼叫update位置的地方呼叫它

2013年5月25日 星期六

Three.js 如何loading blender obj mtl檔

在blender export obj檔
會產生.obj .mtl

在利用three.js load

var loader = new THREE.OBJMTLLoader();
                                loader.addEventListener( 'load', function ( event ) {

                                        var object = event.content;

                                        object.position.y = 0;
                                        scene.add( object );

                                });
                                loader.load( 'obj/male02/monkey.obj', 'obj/male02/monkey.mtl' );


2013年3月24日 星期日

Compiler(1)


第一章

Programming languages are notations for describing computations to people
and to machines.
It first must be translated into a form in which it can be executed by a computer.
The software systems that do this translation are called compilers.

a compiler is a program that can read a program in one lan­
guage - the source language - and translate it into an equivalent program in
another language - the target language.


f we open up this box
a little, we see that there are two parts to this mapping: analysis and synthesis .The analysis part
is often called the front end of the compiler; the synthesis part is the back end.