view Reserve/resources/main.js @ 26:943490f525c5

latest
author <e085737>
date Wed, 16 Feb 2011 22:01:34 +0900
parents
children
line wrap: on
line source

function main(gl, sgroot, w, h){
	//xmlを読む
	sgroot.createFromXMLfile(gl, sgroot, "./xml/pants.xml");
	sgroot.createFromXMLfile(gl, sgroot, "./xml/colorball.xml");
	sgroot.createFromXMLfile(gl, sgroot, "./xml/cube.xml");
	sgroot.createFromXMLfile(gl, sgroot, "./xml/ground.xml");
	sgroot.createFromXMLfile(gl, sgroot, "./xml/earth.xml");
    sgroot.createFromXMLfile(gl, sgroot, "./xml/gap_plane_test.xml");
	sgroot.createFromXMLfile(gl, sgroot, "./xml/moon.xml");
	sgroot.createFromXMLfile(gl, sgroot, "./xml/hand.xml");
	sgroot.createFromXMLfile(gl, sgroot, "./xml/blue.xml");
	sgroot.createFromXMLfile(gl, sgroot, "./xml/human.xml");
	sgroot.createFromXMLfile(gl, sgroot, "./xml/kata.xml");
	sgroot.createFromXMLfile(gl, sgroot, "./xml/road2.xml");
    sgroot.createFromXMLfile(gl, sgroot, "./xml/bullet.xml");
    sgroot.createFromXMLfile(gl, sgroot, "./xml/field.xml");


	//rootの作成
	var root = new sgroot.createSceneGraph3();
	root.set_move_collision(no_move_idle, no_collision_idle);


	//mapの作成
	//root.addChild(createMapFromXMLfile(gl,sgroot,"./xml/map2.xml"));


	//オブジェクトの作成
	var walk_man = createHuman(sgroot, w, h);
	move_length = 0;

	var combat_plane = createPlane(sgroot, w, h);

	var land = new sgroot.createSceneGraph1("ash");
	land.set_move_collision(land_move, no_collision_idle);
	land.angle[1] = 0;
	land.xyz[0] = 0;
	land.xyz[1] = 0;
	land.xyz[2] = 0;
    land.scale = 1.0;

    
	var land2 = new sgroot.createSceneGraph1("Cube");
	land2.set_move_collision(land_move, no_collision_idle);
	land2.angle[0] = -90;
	land2.xyz[0] = 0;
	land2.xyz[1] = 0;
	land2.xyz[2] = 55;


	var wall = new sgroot.createSceneGraph1("Plane");
	//wall.angle[1] = 90;
	wall.xyz[1] = 175;
	wall.xyz[2] = 175;

	var earth = new sgroot.createSceneGraph1("Earth");
	earth.set_move_collision(earth_move, no_collision_idle);

	var moon = new sgroot.createSceneGraph1("Moon");
	moon.xyz[0] = 1000;

	var pants = new sgroot.createSceneGraph1("Pants");
	pants.set_move_collision(pants_move, pants_collision);
	pants.xyz[0] = 100;
	pants.xyz[2] = 500;
	pants.scale = 10;

	var test = new sgroot.createSceneGraph3();
	test.xyz[0] = 0;
	test.xyz[1] = 0;
	test.xyz[2] = 0;
	test.set_move_collision(no_move_idle, no_collision_idle);


	//オブジェクトをシーングラフ化
	root.addChild(land);
	//root.addChild(land2);
	//root.addChild(earth);
	//earth.addChild(moon);
	//root.addChild(test);
	//root.addChild(walk_man);
	//land.addChild(wall);
	//root.addChild(pants);
	root.addChild(combat_plane);
	//combat_plane.addChild(test);
	//root.addChild(createMapFromXMLfile(gl,sgroot,"./xml/map2.xml"));


	//カメラとか(マダ
	sgroot.setCamera(sgroot, root);
	sgroot.setSceneData(root);


	//return sgroot;
}



no_move_idle = function(){
}

no_collision_idle = function(){
}


test_move = function(){
	this.xyz[1] += this.dy * 0.1;
}


earth_move = function(node, sgroot, w, h){
	node.angle[0] += 1
}

test_move = function(node, sgroot, w, h){
	//node.angle[1] += 1;
}