Google Èýά JavaScript API ·¢²¼
O3D ÊÇÒ»¸ö¿ªÔ´µÄWeb API£¬Æä¿ÉÒÔ´´½¨Ï൱ţXµÄ»ùÓÚä¯ÀÀÆ÷µÄ¿É½»»¥Ê½µÄ3DÓ¦Óá£Õâ¸öAPIÔÚºÜÓпÉÄÜ»áÐγÉÒÔºóµÄWebÉϵÄ3DͼÐεıê×¼¡£ÏÂÃæÊÇÕâ¸öAPIµÄÖ÷Õ¾µã£º http://code.google.com/apis/o3d/ ¡£O3DĿǰ֧³ÖWindows, MacºÍLinuxÈýÖÖÆ½Ì¨¡£
ÏÂÃæÊÇһЩ¼òµ¥µØÊ¹ÓÃO3DµÄAPIµÄÈçºÎ´´½¨Ò»¸öÁ¢·½Ì壬¸üÏêϸµÄÄÚÈÝÇë·ÃÎÊO3DµÄÍøÕ¾¡£
1£©Ê×Ñ¡ÎÒÃÇÏÈ´´½¨Ò»¸ö±È½ÏÔʼµÄÁ¢·½Ì塣ʹÓÃcreateCube()·½·¨¡£
01
function createCube(material) {
02
var cubeShape = g_pack.createObject('Shape');
03
var cubePrimitive = g_pack.createObject('Primitive');
04
var streamBank = g_pack.createObject('StreamBank');
05
06
cubePrimitive.material = material;
07
cubePrimitive.owner(cubeShape);
08
cubePrimitive.streamBank = streamBank;
09
.
10
.
11
.
2£©È»ºó£¬ÎÒÃÇÐèÒªÖ¸¶¨Ò»Ð©¶¥µãÐÅÏ¢¡£
ÆäÖУ¬ÎÒÃÇÀûÓÃÈý½ÇÐÎÀ´¹¹Ôì3DͼÐΡ£Ò»¸öÁ¢·½ÌåÓÐ12¸öÈý½ÇÃæ£¬Á½¸ö¹¹³ÉÒ»¸öÃæ£¬È»ºóÓÐ8¸ö¶¥µã¡£
1
cubePrimitive.primitiveType = g_o3d.Primitive.TRIANGLELIST;
2
cubePrimitive.numberPrimitives = 12; // 12 triangles
3
cubePrimitive.numberVertices = 8; // 8 vertices in total
4
cubePrimitive.createDrawElement(g_pack, null); // Create the draw element for this primitive.
3£©Ö¸¶¨Ò»ÏÂ8¸ö¶¥µãµÄ×ø±ê¡£
01
var positionArray = [
02
-0.5, -0.5, 0.5, // vertex 0
03
0.5, -0.5, 0.5, // vertex 1
04
-0.5, 0.5, 0.5, // vertex 2
05
0.5, 0.5, 0.5, // vertex 3
06
-0.5, 0.5, -0.5, // vertex 4
07
0.5, 0.5, -0.5, // vertex 5
08
-0.5, -0.5, -0.5, // vertex 6
09
0.5, -0.5, -0.5 &nb
Ïà¹ØÎĵµ£º
--------------------------------------------------------------------------------
<body>
<mce:script type="text/javascript"><!--
document.write("Èç¹ûÏÔʾÁËÕâ¶ÎÎÄ×Ö£¬ÄÇôÄúµÄä¯ÀÀÆ÷Ö§³Ö JavaScript£¡")
// --></mce:script>
<noscript>No JavaScript support!</noscript&g ......
1.delete ÔËËã·û
¶ÔÏóɾ³ýÒ»¸öÊôÐÔ£¬»òÊý×éÖÐɾ³ýÒ»¸öÔªËØ¡£½«ÎÞÓõÄÄÚÈÝɾ³ýÒÔ½ÚÊ¡¿Õ¼ä¡£
delete expression
example:
var person = new Object();
person.sex = "male";
alert(person.sex);
delete person.sex;
alert(person.sex);
2. ‘,' ÔËËã·û
var a = 2;
......
1
¡¢Àí½âdocument.all
[]
¡¡¡¡´ÓIE4¿ªÊ¼IEµÄobject
model²ÅÔö¼ÓÁËdocument.all
[],À´¿´¿´document.all
[]µÄDescription:
Array
of all HTML tags in the document.Collection of all elements contained by the
object.
¡¡¡¡Ò²¾ÍÊÇ˵document.all
[]ÊÇÎĵµÖÐËùÓбêÇ©×é³ÉµÄÒ»¸öÊý×é±äÁ¿£¬°üÀ¨ÁËÎĵµ¶ÔÏóÖÐËùÓ ......
function get_cookie(Name)
{
var search = Name + "="
var returnvalue = "";
if (document.cookie.length > 0)
{
var offset = document.cookie.indexOf(search)
if (offset != -1)
{
&nbs ......
³ö´¦£ºhttp://www.jcwcn.com/article/2005/1210/javascript_17476.html
<HTML>
<HEAD>
<title>WEBÒ³Ãæµ¼³öΪEXCELÎĵµµÄ·½·¨
</title>
</HEAD>
<body>
<BR>
<table id = "PrintA" width="100%" border="1" cell ......