
function ShootRange(obj,CAngle,CDAngle,X,Y,PX,PY,OriAngle1,OriDis1,OriAngle2,OriDis2,OriAngle3,OriDis3,OriAngle4,OriDis4)
{//写真の切り取り方を指定する。１５００行あるとか酷い。簡略化できるの？
let Difined=false;
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////頂点の一つがシーン外にある場合/////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
		if(Y[0]<GetClipMinY)
		{
		ObjEffect_CreateVertex(obj, 5);

		ObjEffect_SetVertexXY(obj, 0, -PX,-PY-(Y[0]-GetClipMinY)/sin(360-CAngle-CDAngle+90));
		ObjEffect_SetVertexXY(obj, 1, -PX-(Y[0]-GetClipMinY)/cos(360-CAngle-CDAngle+90), -PY);
		ObjEffect_SetVertexXY(obj, 2, PX,  -PY);
		ObjEffect_SetVertexXY(obj, 3, PX, PY);
		ObjEffect_SetVertexXY(obj, 4,  -PX,  PY);
		
		ObjEffect_SetVertexUV(obj, 0,  X[0]+(Y[0]-GetClipMinY)/tan(360-CAngle-CDAngle+90),  GetClipMinY);
		ObjEffect_SetVertexUV(obj, 1,  X[0]-(Y[0]-GetClipMinY)*tan(360-CAngle-CDAngle+90),  GetClipMinY);
		ObjEffect_SetVertexUV(obj, 2,  X[1], Y[1]);
		ObjEffect_SetVertexUV(obj, 3, X[2],  Y[2]);
		ObjEffect_SetVertexUV(obj, 4, X[3], Y[3]);
		}

		if(Y[0]>GetClipMaxY)
		{
		ObjEffect_CreateVertex(obj, 5);

		ObjEffect_SetVertexXY(obj, 0, -PX,-PY-(Y[0]-GetClipMaxY)/sin(360-CAngle-CDAngle+90));
		ObjEffect_SetVertexXY(obj, 1, -PX-(Y[0]-GetClipMaxY)/cos(360-CAngle-CDAngle+90), -PY);
		ObjEffect_SetVertexXY(obj, 2, PX,  -PY);
		ObjEffect_SetVertexXY(obj, 3, PX, PY);
		ObjEffect_SetVertexXY(obj, 4,  -PX,  PY);
		
		ObjEffect_SetVertexUV(obj, 0,  X[0]+(Y[0]-GetClipMaxY)/tan(360-CAngle-CDAngle+90),  GetClipMaxY);
		ObjEffect_SetVertexUV(obj, 1,  X[0]-(Y[0]-GetClipMaxY)*tan(360-CAngle-CDAngle+90),  GetClipMaxY);
		ObjEffect_SetVertexUV(obj, 2,  X[1], Y[1]);
		ObjEffect_SetVertexUV(obj, 3, X[2],  Y[2]);
		ObjEffect_SetVertexUV(obj, 4, X[3], Y[3]);
		}

		if(X[0]<GetClipMinX)
		{
		ObjEffect_CreateVertex(obj, 5);

		ObjEffect_SetVertexXY(obj, 0, -PX, -PY-(X[0]-GetClipMinX)/cos(CAngle-180+CDAngle-90));
		ObjEffect_SetVertexXY(obj, 1, -PX-(X[0]-GetClipMinX)/sin(CAngle-180+CDAngle-90), -PY);
		ObjEffect_SetVertexXY(obj, 2, PX,  -PY);
		ObjEffect_SetVertexXY(obj, 3, PX, PY);
		ObjEffect_SetVertexXY(obj, 4,  -PX,  PY);
		
		ObjEffect_SetVertexUV(obj, 0,  GetClipMinX,  Y[0]-(X[0]-GetClipMinX)*tan(CAngle-180+CDAngle-90));
		ObjEffect_SetVertexUV(obj, 1,  GetClipMinX,  Y[0]+(X[0]-GetClipMinX)/tan(CAngle-180+CDAngle-90));
		ObjEffect_SetVertexUV(obj, 2,  X[1], Y[1]);
		ObjEffect_SetVertexUV(obj, 3, X[2],  Y[2]);
		ObjEffect_SetVertexUV(obj, 4, X[3], Y[3]);
		}

		if(X[0]>GetClipMaxX)
		{
		ObjEffect_CreateVertex(obj, 5);

		ObjEffect_SetVertexXY(obj, 0, -PX, -PY-(X[0]-GetClipMaxX)/cos(CAngle-180+CDAngle-90));
		ObjEffect_SetVertexXY(obj, 1, -PX-(X[0]-GetClipMaxX)/sin(CAngle-180+CDAngle-90), -PY);
		ObjEffect_SetVertexXY(obj, 2, PX,  -PY);
		ObjEffect_SetVertexXY(obj, 3, PX, PY);
		ObjEffect_SetVertexXY(obj, 4,  -PX,  PY);
		
		ObjEffect_SetVertexUV(obj, 0,  GetClipMaxX,  Y[0]-(X[0]-GetClipMaxX)*tan(CAngle-180+CDAngle-90));
		ObjEffect_SetVertexUV(obj, 1,  GetClipMaxX,  Y[0]+(X[0]-GetClipMaxX)/tan(CAngle-180+CDAngle-90));
		ObjEffect_SetVertexUV(obj, 2,  X[1], Y[1]);
		ObjEffect_SetVertexUV(obj, 3, X[2],  Y[2]);
		ObjEffect_SetVertexUV(obj, 4, X[3], Y[3]);
		}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
		if(Y[1]<GetClipMinY)
		{
		ObjEffect_CreateVertex(obj, 5);

		ObjEffect_SetVertexXY(obj, 0, -PX,-PY);
		ObjEffect_SetVertexXY(obj, 1, PX+(Y[1]-GetClipMinY)/cos(CAngle-180+CDAngle-90),  -PY);
		ObjEffect_SetVertexXY(obj, 2, PX, -PY-(Y[1]-GetClipMinY)/sin(CAngle-180+CDAngle-90));
		ObjEffect_SetVertexXY(obj, 3, PX, PY);
		ObjEffect_SetVertexXY(obj, 4,  -PX,  PY);
		
		ObjEffect_SetVertexUV(obj, 0,  X[0],Y[0]);
		ObjEffect_SetVertexUV(obj, 1,  X[1]+(Y[1]-GetClipMinY)*tan(CAngle-180+CDAngle-90),  GetClipMinY);
		ObjEffect_SetVertexUV(obj, 2,  X[1]-(Y[1]-GetClipMinY)/tan(CAngle-180+CDAngle-90),  GetClipMinY);
		ObjEffect_SetVertexUV(obj, 3, X[2],  Y[2]);
		ObjEffect_SetVertexUV(obj, 4, X[3], Y[3]);
		}

		if(Y[1]>GetClipMaxY)
		{
		ObjEffect_CreateVertex(obj, 5);

		ObjEffect_SetVertexXY(obj, 0, -PX,-PY);
		ObjEffect_SetVertexXY(obj, 1, PX+(Y[1]-GetClipMaxY)/cos(CAngle-180+CDAngle-90),  -PY);
		ObjEffect_SetVertexXY(obj, 2, PX, -PY-(Y[1]-GetClipMaxY)/sin(CAngle-180+CDAngle-90));
		ObjEffect_SetVertexXY(obj, 3, PX, PY);
		ObjEffect_SetVertexXY(obj, 4,  -PX,  PY);
		
		ObjEffect_SetVertexUV(obj, 0,  X[0],Y[0]);
		ObjEffect_SetVertexUV(obj, 1,  X[1]+(Y[1]-GetClipMaxY)*tan(CAngle-180+CDAngle-90),  GetClipMaxY);
		ObjEffect_SetVertexUV(obj, 2,  X[1]-(Y[1]-GetClipMaxY)/tan(CAngle-180+CDAngle-90),  GetClipMaxY);
		ObjEffect_SetVertexUV(obj, 3, X[2],  Y[2]);
		ObjEffect_SetVertexUV(obj, 4, X[3], Y[3]);
		}


		if(X[1]<GetClipMinX)
		{
		ObjEffect_CreateVertex(obj, 5);

		ObjEffect_SetVertexXY(obj, 0, -PX, -PY);
		ObjEffect_SetVertexXY(obj, 1, PX+(X[1]-GetClipMinX)/cos(CAngle-90+CDAngle-90),  -PY);
		ObjEffect_SetVertexXY(obj, 2, PX,  -PY-(X[1]-GetClipMinX)/sin(CAngle-90+CDAngle-90));
		ObjEffect_SetVertexXY(obj, 3, PX, PY);
		ObjEffect_SetVertexXY(obj, 4,  -PX,  PY);
		
		ObjEffect_SetVertexUV(obj, 0,  X[0],  Y[0]);
		ObjEffect_SetVertexUV(obj, 1,  GetClipMinX, Y[1]-(X[1]-GetClipMinX)*tan(CAngle-90+CDAngle-90));
		ObjEffect_SetVertexUV(obj, 2,  GetClipMinX, Y[1]+(X[1]-GetClipMinX)/tan(CAngle-90+CDAngle-90));
		ObjEffect_SetVertexUV(obj, 3, X[2],  Y[2]);
		ObjEffect_SetVertexUV(obj, 4, X[3], Y[3]);
		}

		if(X[1]>GetClipMaxX)
		{
		ObjEffect_CreateVertex(obj, 5);

		ObjEffect_SetVertexXY(obj, 0, -PX, -PY);
		ObjEffect_SetVertexXY(obj, 1, PX+(X[1]-GetClipMaxX)/cos(CAngle-90+CDAngle-90),  -PY);
		ObjEffect_SetVertexXY(obj, 2, PX,  -PY-(X[1]-GetClipMaxX)/sin(CAngle-90+CDAngle-90));
		ObjEffect_SetVertexXY(obj, 3, PX, PY);
		ObjEffect_SetVertexXY(obj, 4,  -PX,  PY);
		
		ObjEffect_SetVertexUV(obj, 0,  X[0],  Y[0]);
		ObjEffect_SetVertexUV(obj, 1,  GetClipMaxX, Y[1]-(X[1]-GetClipMaxX)*tan(CAngle-90+CDAngle-90));
		ObjEffect_SetVertexUV(obj, 2,  GetClipMaxX, Y[1]+(X[1]-GetClipMaxX)/tan(CAngle-90+CDAngle-90));
		ObjEffect_SetVertexUV(obj, 3, X[2],  Y[2]);
		ObjEffect_SetVertexUV(obj, 4, X[3], Y[3]);
		}
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
		if(Y[2]<GetClipMinY)
		{
		ObjEffect_CreateVertex(obj, 5);

		ObjEffect_SetVertexXY(obj, 0, -PX, -PY);
		ObjEffect_SetVertexXY(obj, 1, PX,  -PY);
		ObjEffect_SetVertexXY(obj, 2, PX, PY+(Y[2]-GetClipMinY)/sin(360-CAngle-180-CDAngle+90));
		ObjEffect_SetVertexXY(obj, 3, PX+(Y[2]-GetClipMinY)/cos(360-CAngle-180-CDAngle+90), PY);
		ObjEffect_SetVertexXY(obj, 4,  -PX,  PY);
		
		ObjEffect_SetVertexUV(obj, 0,  X[0],  Y[0]);
		ObjEffect_SetVertexUV(obj, 1,  X[1], Y[1]);
		ObjEffect_SetVertexUV(obj, 2, X[2]+(Y[2]-GetClipMinY)/tan(360-CAngle-180-CDAngle+90),  GetClipMinY);
		ObjEffect_SetVertexUV(obj, 3, X[2]-(Y[2]-GetClipMinY)*tan(360-CAngle-180-CDAngle+90),  GetClipMinY);
		ObjEffect_SetVertexUV(obj, 4, X[3], Y[3]);
		}

		if(Y[2]>GetClipMaxY)
		{
		ObjEffect_CreateVertex(obj, 5);

		ObjEffect_SetVertexXY(obj, 0, -PX, -PY);
		ObjEffect_SetVertexXY(obj, 1, PX,  -PY);
		ObjEffect_SetVertexXY(obj, 2, PX, PY+(Y[2]-GetClipMaxY)/sin(360-CAngle-180-CDAngle+90));
		ObjEffect_SetVertexXY(obj, 3, PX+(Y[2]-GetClipMaxY)/cos(360-CAngle-180-CDAngle+90), PY);
		ObjEffect_SetVertexXY(obj, 4,  -PX,  PY);
		
		ObjEffect_SetVertexUV(obj, 0,  X[0],  Y[0]);
		ObjEffect_SetVertexUV(obj, 1,  X[1], Y[1]);
		ObjEffect_SetVertexUV(obj, 2, X[2]+(Y[2]-GetClipMaxY)/tan(360-CAngle-180-CDAngle+90),  GetClipMaxY);
		ObjEffect_SetVertexUV(obj, 3, X[2]-(Y[2]-GetClipMaxY)*tan(360-CAngle-180-CDAngle+90),  GetClipMaxY);
		ObjEffect_SetVertexUV(obj, 4, X[3], Y[3]);
		}

		if(X[2]<GetClipMinX)
		{
		ObjEffect_CreateVertex(obj, 5);

		ObjEffect_SetVertexXY(obj, 0, -PX, -PY);
		ObjEffect_SetVertexXY(obj, 1, PX,  -PY);
		ObjEffect_SetVertexXY(obj, 2, PX, PY+(X[2]-GetClipMinX)/cos(CAngle+CDAngle-90));
		ObjEffect_SetVertexXY(obj, 3, PX+(X[2]-GetClipMinX)/sin(CAngle+CDAngle-90), PY);
		ObjEffect_SetVertexXY(obj, 4,  -PX,  PY);
		
		ObjEffect_SetVertexUV(obj, 0,  X[0],  Y[0]);
		ObjEffect_SetVertexUV(obj, 1,  X[1], Y[1]);
		ObjEffect_SetVertexUV(obj, 2, GetClipMinX,  Y[2]-(X[2]-GetClipMinX)*tan(CAngle+CDAngle-90));
		ObjEffect_SetVertexUV(obj, 3, GetClipMinX,  Y[2]+(X[2]-GetClipMinX)/tan(CAngle+CDAngle-90));
		ObjEffect_SetVertexUV(obj, 4, X[3], Y[3]);
		}

		if(X[2]>GetClipMaxX)
		{
		ObjEffect_CreateVertex(obj, 5);

		ObjEffect_SetVertexXY(obj, 0, -PX, -PY);
		ObjEffect_SetVertexXY(obj, 1, PX,  -PY);
		ObjEffect_SetVertexXY(obj, 2, PX, PY+(X[2]-GetClipMaxX)/cos(CAngle+CDAngle-90));
		ObjEffect_SetVertexXY(obj, 3, PX+(X[2]-GetClipMaxX)/sin(CAngle+CDAngle-90), PY);
		ObjEffect_SetVertexXY(obj, 4,  -PX,  PY);
		
		ObjEffect_SetVertexUV(obj, 0,  X[0],  Y[0]);
		ObjEffect_SetVertexUV(obj, 1,  X[1], Y[1]);
		ObjEffect_SetVertexUV(obj, 2, GetClipMaxX,  Y[2]-(X[2]-GetClipMaxX)*tan(CAngle+CDAngle-90));
		ObjEffect_SetVertexUV(obj, 3, GetClipMaxX,  Y[2]+(X[2]-GetClipMaxX)/tan(CAngle+CDAngle-90));
		ObjEffect_SetVertexUV(obj, 4, X[3], Y[3]);
		}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
		if(Y[3]<GetClipMinY)
		{
		ObjEffect_CreateVertex(obj, 5);

		ObjEffect_SetVertexXY(obj, 0, -PX, -PY);
		ObjEffect_SetVertexXY(obj, 1, PX,  -PY);
		ObjEffect_SetVertexXY(obj, 2, PX, PY);
		ObjEffect_SetVertexXY(obj, 3,  -PX-(Y[3]-GetClipMinY)/cos(CAngle-360+CDAngle-90),  PY);
		ObjEffect_SetVertexXY(obj, 4,  -PX,  PY+(Y[3]-GetClipMinY)/sin(CAngle-360+CDAngle-90));
		
		ObjEffect_SetVertexUV(obj, 0,  X[0],  Y[0]);
		ObjEffect_SetVertexUV(obj, 1,  X[1], Y[1]);
		ObjEffect_SetVertexUV(obj, 2, X[2],  Y[2]);
		ObjEffect_SetVertexUV(obj, 3,X[3]+(Y[3]-GetClipMinY)*tan(CAngle-180+CDAngle-90),  GetClipMinY);
		ObjEffect_SetVertexUV(obj, 4, X[3]-(Y[3]-GetClipMinY)/tan(CAngle-180+CDAngle-90),  GetClipMinY);
		}

		if(Y[3]>GetClipMaxY)
		{
		ObjEffect_CreateVertex(obj, 5);

		ObjEffect_SetVertexXY(obj, 0, -PX, -PY);
		ObjEffect_SetVertexXY(obj, 1, PX,  -PY);
		ObjEffect_SetVertexXY(obj, 2, PX, PY);
		ObjEffect_SetVertexXY(obj, 3,  -PX-(Y[3]-GetClipMaxY)/cos(CAngle-360+CDAngle-90),  PY);
		ObjEffect_SetVertexXY(obj, 4,  -PX,  PY+(Y[3]-GetClipMaxY)/sin(CAngle-360+CDAngle-90));
		
		ObjEffect_SetVertexUV(obj, 0,  X[0],  Y[0]);
		ObjEffect_SetVertexUV(obj, 1,  X[1], Y[1]);
		ObjEffect_SetVertexUV(obj, 2, X[2],  Y[2]);
		ObjEffect_SetVertexUV(obj, 3,X[3]+(Y[3]-GetClipMaxY)*tan(CAngle-180+CDAngle-90),  GetClipMaxY);
		ObjEffect_SetVertexUV(obj, 4, X[3]-(Y[3]-GetClipMaxY)/tan(CAngle-180+CDAngle-90),  GetClipMaxY);
		}

		if(X[3]<GetClipMinX)
		{
		ObjEffect_CreateVertex(obj, 5);

		ObjEffect_SetVertexXY(obj, 0, -PX, -PY);
		ObjEffect_SetVertexXY(obj, 1, PX,  -PY);
		ObjEffect_SetVertexXY(obj, 2, PX, PY);
		ObjEffect_SetVertexXY(obj, 3,  -PX-(X[3]-GetClipMinX)/cos(CAngle-270+CDAngle-90),  PY);
		ObjEffect_SetVertexXY(obj, 4,  -PX,  PY+(X[3]-GetClipMinX)/sin(CAngle-270+CDAngle-90));
		
		ObjEffect_SetVertexUV(obj, 0,  X[0],  Y[0]);
		ObjEffect_SetVertexUV(obj, 1,  X[1], Y[1]);
		ObjEffect_SetVertexUV(obj, 2, X[2],  Y[2]);
		ObjEffect_SetVertexUV(obj, 3, GetClipMinX, Y[3]-(X[3]-GetClipMinX)*tan(CAngle-270+CDAngle-90));
		ObjEffect_SetVertexUV(obj, 4, GetClipMinX, Y[3]+(X[3]-GetClipMinX)/tan(CAngle-270+CDAngle-90));
		}

		if(X[3]>GetClipMaxX)
		{
		ObjEffect_CreateVertex(obj, 5);

		ObjEffect_SetVertexXY(obj, 0, -PX, -PY);
		ObjEffect_SetVertexXY(obj, 1, PX,  -PY);
		ObjEffect_SetVertexXY(obj, 2, PX, PY);
		ObjEffect_SetVertexXY(obj, 3,  -PX-(X[3]-GetClipMaxX)/cos(CAngle-270+CDAngle-90),  PY);
		ObjEffect_SetVertexXY(obj, 4,  -PX,  PY+(X[3]-GetClipMaxX)/sin(CAngle-270+CDAngle-90));
		
		ObjEffect_SetVertexUV(obj, 0,  X[0],  Y[0]);
		ObjEffect_SetVertexUV(obj, 1,  X[1], Y[1]);
		ObjEffect_SetVertexUV(obj, 2, X[2],  Y[2]);
		ObjEffect_SetVertexUV(obj, 3, GetClipMaxX, Y[3]-(X[3]-GetClipMaxX)*tan(CAngle-270+CDAngle-90));
		ObjEffect_SetVertexUV(obj, 4, GetClipMaxX, Y[3]+(X[3]-GetClipMaxX)/tan(CAngle-270+CDAngle-90));
		}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
///////////頂点の二つがＸ座標、Ｙ座標同士でシーン外にある場合///////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
		if(Y[0]<GetClipMinY && Y[1]<GetClipMinY)
		{
		ObjEffect_CreateVertex(obj, 4);
Difined=true;
		ObjEffect_SetVertexXY(obj, 0, -PX, -PY-(Y[0]-GetClipMinY)/sin(CAngle-180+CDAngle-90));
		ObjEffect_SetVertexXY(obj, 1, PX,  -PY-(Y[1]-GetClipMinY)/sin(CAngle-180+CDAngle-90));
		ObjEffect_SetVertexXY(obj, 2, PX, PY);
		ObjEffect_SetVertexXY(obj, 3,  -PX,  PY);
		
		ObjEffect_SetVertexUV(obj, 0,  X[0]-(Y[0]-GetClipMinY)/tan(CAngle-180+CDAngle-90),  GetClipMinY);
		ObjEffect_SetVertexUV(obj, 1,  X[1]-(Y[1]-GetClipMinY)/tan(CAngle-180+CDAngle-90), GetClipMinY);
		ObjEffect_SetVertexUV(obj, 2, X[2],  Y[2]);
		ObjEffect_SetVertexUV(obj, 3, X[3], Y[3]);
		}

		if(Y[0]>GetClipMaxY && Y[1]>GetClipMaxY)
		{
		ObjEffect_CreateVertex(obj, 4);
Difined=true;
		ObjEffect_SetVertexXY(obj, 0, -PX, -PY-(Y[0]-GetClipMaxY)/sin(CAngle-180+CDAngle-90));
		ObjEffect_SetVertexXY(obj, 1, PX,  -PY-(Y[1]-GetClipMaxY)/sin(CAngle-180+CDAngle-90));
		ObjEffect_SetVertexXY(obj, 2, PX, PY);
		ObjEffect_SetVertexXY(obj, 3,  -PX,  PY);
		
		ObjEffect_SetVertexUV(obj, 0,  X[0]-(Y[0]-GetClipMaxY)/tan(CAngle-180+CDAngle-90),  GetClipMaxY);
		ObjEffect_SetVertexUV(obj, 1,  X[1]-(Y[1]-GetClipMaxY)/tan(CAngle-180+CDAngle-90), GetClipMaxY);
		ObjEffect_SetVertexUV(obj, 2, X[2],  Y[2]);
		ObjEffect_SetVertexUV(obj, 3, X[3], Y[3]);
		}

		if(X[0]<GetClipMinX && X[1]<GetClipMinX)
		{
		ObjEffect_CreateVertex(obj, 4);
Difined=true;
		ObjEffect_SetVertexXY(obj, 0, -PX, -PY-(X[0]-GetClipMinX)/cos(CAngle-180+CDAngle-90));
		ObjEffect_SetVertexXY(obj, 1, PX,  -PY-(X[1]-GetClipMinX)/cos(CAngle-180+CDAngle-90));
		ObjEffect_SetVertexXY(obj, 2, PX, PY);
		ObjEffect_SetVertexXY(obj, 3,  -PX,  PY);
		
		ObjEffect_SetVertexUV(obj, 0,  GetClipMinX,  Y[0]-(X[0]-GetClipMinX)*tan(CAngle-180+CDAngle-90));
		ObjEffect_SetVertexUV(obj, 1,  GetClipMinX, Y[1]-(X[1]-GetClipMinX)*tan(CAngle-180+CDAngle-90));
		ObjEffect_SetVertexUV(obj, 2, X[2],  Y[2]);
		ObjEffect_SetVertexUV(obj, 3, X[3], Y[3]);
		}


		if(X[0]>GetClipMaxX && X[1]>GetClipMaxX)
		{
		ObjEffect_CreateVertex(obj, 4);
Difined=true;
		ObjEffect_SetVertexXY(obj, 0, -PX, -PY-(X[0]-GetClipMaxX)/cos(CAngle-180+CDAngle-90));
		ObjEffect_SetVertexXY(obj, 1, PX,  -PY-(X[1]-GetClipMaxX)/cos(CAngle-180+CDAngle-90));
		ObjEffect_SetVertexXY(obj, 2, PX, PY);
		ObjEffect_SetVertexXY(obj, 3,  -PX,  PY);
		
		ObjEffect_SetVertexUV(obj, 0,  GetClipMaxX,  Y[0]-(X[0]-GetClipMaxX)*tan(CAngle-180+CDAngle-90));
		ObjEffect_SetVertexUV(obj, 1,  GetClipMaxX, Y[1]-(X[1]-GetClipMaxX)*tan(CAngle-180+CDAngle-90));
		ObjEffect_SetVertexUV(obj, 2, X[2],  Y[2]);
		ObjEffect_SetVertexUV(obj, 3, X[3], Y[3]);
		}
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
		if(Y[1]<GetClipMinY && Y[2]<GetClipMinY)
		{
		ObjEffect_CreateVertex(obj, 4);
Difined=true;
		ObjEffect_SetVertexXY(obj, 0, -PX, -PY);
		ObjEffect_SetVertexXY(obj, 1, PX+(Y[1]-GetClipMinY)/sin(270-CAngle-CDAngle+90),  -PY);
		ObjEffect_SetVertexXY(obj, 2, PX+(Y[2]-GetClipMinY)/sin(270-CAngle-CDAngle+90), PY);
		ObjEffect_SetVertexXY(obj, 3,  -PX,  PY);
		
		ObjEffect_SetVertexUV(obj, 0,  X[0],  Y[0]);
		ObjEffect_SetVertexUV(obj, 1,  X[1]+(Y[1]-GetClipMinY)/tan(270-CAngle-CDAngle+90), GetClipMinY);
		ObjEffect_SetVertexUV(obj, 2, X[2]+(Y[2]-GetClipMinY)/tan(270-CAngle-CDAngle+90),  GetClipMinY);
		ObjEffect_SetVertexUV(obj, 3, X[3], Y[3]);
		}

		if(Y[1]>GetClipMaxY && Y[2]>GetClipMaxY)
		{
		ObjEffect_CreateVertex(obj, 4);
Difined=true;
		ObjEffect_SetVertexXY(obj, 0, -PX, -PY);
		ObjEffect_SetVertexXY(obj, 1, PX+(Y[1]-GetClipMaxY)/sin(270-CAngle-CDAngle+90),  -PY);
		ObjEffect_SetVertexXY(obj, 2, PX+(Y[2]-GetClipMaxY)/sin(270-CAngle-CDAngle+90), PY);
		ObjEffect_SetVertexXY(obj, 3,  -PX,  PY);
		
		ObjEffect_SetVertexUV(obj, 0,  X[0],  Y[0]);
		ObjEffect_SetVertexUV(obj, 1,  X[1]+(Y[1]-GetClipMaxY)/tan(270-CAngle-CDAngle+90), GetClipMaxY);
		ObjEffect_SetVertexUV(obj, 2, X[2]+(Y[2]-GetClipMaxY)/tan(270-CAngle-CDAngle+90),  GetClipMaxY);
		ObjEffect_SetVertexUV(obj, 3, X[3], Y[3]);
		}

		if(X[1]<GetClipMinX && X[2]<GetClipMinX)
		{
		ObjEffect_CreateVertex(obj, 4);
Difined=true;
		ObjEffect_SetVertexXY(obj, 0, -PX, -PY);
		ObjEffect_SetVertexXY(obj, 1, PX+(X[1]-GetClipMinX)/cos(CAngle-90+CDAngle-90),  -PY);
		ObjEffect_SetVertexXY(obj, 2, PX+(X[2]-GetClipMinX)/cos(CAngle-90+CDAngle-90), PY);
		ObjEffect_SetVertexXY(obj, 3,  -PX,  PY);
		
		ObjEffect_SetVertexUV(obj, 0,  X[0],  Y[0]);
		ObjEffect_SetVertexUV(obj, 1,  GetClipMinX, Y[1]-(X[1]-GetClipMinX)*tan(CAngle-90+CDAngle-90));
		ObjEffect_SetVertexUV(obj, 2, GetClipMinX,  Y[2]-(X[2]-GetClipMinX)*tan(CAngle-90+CDAngle-90));
		ObjEffect_SetVertexUV(obj, 3, X[3], Y[3]);
		}

		if(X[1]>GetClipMaxX && X[2]>GetClipMaxX)
		{
		ObjEffect_CreateVertex(obj, 4);
Difined=true;
		ObjEffect_SetVertexXY(obj, 0, -PX, -PY);
		ObjEffect_SetVertexXY(obj, 1, PX+(X[1]-GetClipMaxX)/cos(CAngle-90+CDAngle-90),  -PY);
		ObjEffect_SetVertexXY(obj, 2, PX+(X[2]-GetClipMaxX)/cos(CAngle-90+CDAngle-90), PY);
		ObjEffect_SetVertexXY(obj, 3,  -PX,  PY);
		
		ObjEffect_SetVertexUV(obj, 0,  X[0],  Y[0]);
		ObjEffect_SetVertexUV(obj, 1,  GetClipMaxX, Y[1]-(X[1]-GetClipMaxX)*tan(CAngle-90+CDAngle-90));
		ObjEffect_SetVertexUV(obj, 2, GetClipMaxX,  Y[2]-(X[2]-GetClipMaxX)*tan(CAngle-90+CDAngle-90));
		ObjEffect_SetVertexUV(obj, 3, X[3], Y[3]);
		}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
		if(Y[2]<GetClipMinY && Y[3]<GetClipMinY)
		{
		ObjEffect_CreateVertex(obj, 4);
Difined=true;
		ObjEffect_SetVertexXY(obj, 0, -PX, -PY);
		ObjEffect_SetVertexXY(obj, 1, PX,  -PY);
		ObjEffect_SetVertexXY(obj, 2, PX, PY+(Y[2]-GetClipMinY)/sin(CAngle+CDAngle-90));
		ObjEffect_SetVertexXY(obj, 3,  -PX,  PY+(Y[3]-GetClipMinY)/sin(CAngle+CDAngle-90));
		
		ObjEffect_SetVertexUV(obj, 0,  X[0],  Y[0]);
		ObjEffect_SetVertexUV(obj, 1,  X[1], Y[1]);
		ObjEffect_SetVertexUV(obj, 2, X[2]-(Y[2]-GetClipMinY)/tan(CAngle+CDAngle-90),  GetClipMinY);
		ObjEffect_SetVertexUV(obj, 3, X[3]-(Y[3]-GetClipMinY)/tan(CAngle+CDAngle-90), GetClipMinY);
		}

		if(Y[2]>GetClipMaxY && Y[3]>GetClipMaxY)
		{
		ObjEffect_CreateVertex(obj, 4);
Difined=true;
		ObjEffect_SetVertexXY(obj, 0, -PX, -PY);
		ObjEffect_SetVertexXY(obj, 1, PX,  -PY);
		ObjEffect_SetVertexXY(obj, 2, PX, PY+(Y[2]-GetClipMaxY)/sin(CAngle+CDAngle-90));
		ObjEffect_SetVertexXY(obj, 3,  -PX,  PY+(Y[3]-GetClipMaxY)/sin(CAngle+CDAngle-90));
		
		ObjEffect_SetVertexUV(obj, 0,  X[0],  Y[0]);
		ObjEffect_SetVertexUV(obj, 1,  X[1], Y[1]);
		ObjEffect_SetVertexUV(obj, 2, X[2]+(Y[2]-GetClipMaxY)/tan(CAngle+CDAngle-90),  GetClipMaxY);
		ObjEffect_SetVertexUV(obj, 3, X[3]+(Y[3]-GetClipMaxY)/tan(CAngle+CDAngle-90), GetClipMaxY);
		}

		if(X[2]<GetClipMinX && X[3]<GetClipMinX)
		{
		ObjEffect_CreateVertex(obj, 4);
Difined=true;
		ObjEffect_SetVertexXY(obj, 0, -PX, -PY);
		ObjEffect_SetVertexXY(obj, 1, PX,  -PY);
		ObjEffect_SetVertexXY(obj, 2, PX, PY+(X[2]-GetClipMinX)/cos(CAngle+CDAngle-90));
		ObjEffect_SetVertexXY(obj, 3,  -PX,  PY+(X[3]-GetClipMinX)/cos(CAngle+CDAngle-90));
		
		ObjEffect_SetVertexUV(obj, 0,  X[0],  Y[0]);
		ObjEffect_SetVertexUV(obj, 1,  X[1], Y[1]);
		ObjEffect_SetVertexUV(obj, 2, GetClipMinX,  Y[2]-(X[2]-GetClipMinX)*tan(CAngle+CDAngle-90));
		ObjEffect_SetVertexUV(obj, 3, GetClipMinX, Y[3]-(X[3]-GetClipMinX)*tan(CAngle+CDAngle-90));
		}

		if(X[2]>GetClipMaxX && X[3]>GetClipMaxX)
		{
		ObjEffect_CreateVertex(obj, 4);
Difined=true;
		ObjEffect_SetVertexXY(obj, 0, -PX, -PY);
		ObjEffect_SetVertexXY(obj, 1, PX,  -PY);
		ObjEffect_SetVertexXY(obj, 2, PX, PY+(X[2]-GetClipMaxX)/cos(CAngle+CDAngle-90));
		ObjEffect_SetVertexXY(obj, 3,  -PX,  PY+(X[3]-GetClipMaxX)/cos(CAngle+CDAngle-90));
		
		ObjEffect_SetVertexUV(obj, 0,  X[0],  Y[0]);
		ObjEffect_SetVertexUV(obj, 1,  X[1], Y[1]);
		ObjEffect_SetVertexUV(obj, 2, GetClipMaxX,  Y[2]-(X[2]-GetClipMaxX)*tan(CAngle+CDAngle-90));
		ObjEffect_SetVertexUV(obj, 3, GetClipMaxX, Y[3]-(X[3]-GetClipMaxX)*tan(CAngle+CDAngle-90));
		}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
		if(Y[3]<GetClipMinY && Y[0]<GetClipMinY)
		{
		ObjEffect_CreateVertex(obj, 4);
Difined=true;
		ObjEffect_SetVertexXY(obj, 0, -PX-(Y[0]-GetClipMinY)/sin(CAngle-270+CDAngle-90), -PY);
		ObjEffect_SetVertexXY(obj, 1, PX,  -PY);
		ObjEffect_SetVertexXY(obj, 2, PX, PY);
		ObjEffect_SetVertexXY(obj, 3,  -PX-(Y[3]-GetClipMinY)/sin(CAngle-270+CDAngle-90),  PY);
		
		ObjEffect_SetVertexUV(obj, 0,  X[0]-(Y[0]-GetClipMinY)/tan(CAngle-270+CDAngle-90), GetClipMinY);
		ObjEffect_SetVertexUV(obj, 1,  X[1], Y[1]);
		ObjEffect_SetVertexUV(obj, 2, X[2],  Y[2]);
		ObjEffect_SetVertexUV(obj, 3, X[3]-(Y[3]-GetClipMinY)/tan(CAngle-270+CDAngle-90), GetClipMinY);
		}

		if(Y[3]>GetClipMaxY && Y[0]>GetClipMaxY)
		{
		ObjEffect_CreateVertex(obj, 4);
Difined=true;
		ObjEffect_SetVertexXY(obj, 0, -PX-(Y[0]-GetClipMaxY)/sin(CAngle-270+CDAngle-90), -PY);
		ObjEffect_SetVertexXY(obj, 1, PX,  -PY);
		ObjEffect_SetVertexXY(obj, 2, PX, PY);
		ObjEffect_SetVertexXY(obj, 3,  -PX-(Y[3]-GetClipMaxY)/sin(CAngle-270+CDAngle-90),  PY);
		
		ObjEffect_SetVertexUV(obj, 0,  X[0]-(Y[0]-GetClipMaxY)/tan(CAngle-270+CDAngle-90), GetClipMaxY);
		ObjEffect_SetVertexUV(obj, 1,  X[1], Y[1]);
		ObjEffect_SetVertexUV(obj, 2, X[2],  Y[2]);
		ObjEffect_SetVertexUV(obj, 3, X[3]-(Y[3]-GetClipMaxY)/tan(CAngle-270+CDAngle-90), GetClipMaxY);
		}

		if(X[3]<GetClipMinX && X[0]<GetClipMinX)
		{
		ObjEffect_CreateVertex(obj, 4);
Difined=true;
		ObjEffect_SetVertexXY(obj, 0, -PX-(X[0]-GetClipMinX)/cos(CAngle+90+CDAngle-90), -PY);
		ObjEffect_SetVertexXY(obj, 1, PX,  -PY);
		ObjEffect_SetVertexXY(obj, 2, PX, PY);
		ObjEffect_SetVertexXY(obj, 3,  -PX-(X[3]-GetClipMinX)/cos(CAngle+90+CDAngle-90),  PY);
		
		ObjEffect_SetVertexUV(obj, 0,  GetClipMinX,  Y[0]-(X[0]-GetClipMinX)*tan(CAngle+90+CDAngle-90));
		ObjEffect_SetVertexUV(obj, 1,  X[1], Y[1]);
		ObjEffect_SetVertexUV(obj, 2, X[2],  Y[2]);
		ObjEffect_SetVertexUV(obj, 3, GetClipMinX, Y[3]-(X[3]-GetClipMinX)*tan(CAngle+90+CDAngle-90));
		}

		if(X[3]>GetClipMaxX && X[0]>GetClipMaxX)
		{
		ObjEffect_CreateVertex(obj, 4);
Difined=true;
		ObjEffect_SetVertexXY(obj, 0, -PX-(X[0]-GetClipMaxX)/cos(CAngle+90+CDAngle-90), -PY);
		ObjEffect_SetVertexXY(obj, 1, PX,  -PY);
		ObjEffect_SetVertexXY(obj, 2, PX, PY);
		ObjEffect_SetVertexXY(obj, 3,  -PX-(X[3]-GetClipMaxX)/cos(CAngle+90+CDAngle-90),  PY);
		
		ObjEffect_SetVertexUV(obj, 0,  GetClipMaxX,  Y[0]-(X[0]-GetClipMaxX)*tan(CAngle+90+CDAngle-90));
		ObjEffect_SetVertexUV(obj, 1,  X[1], Y[1]);
		ObjEffect_SetVertexUV(obj, 2, X[2],  Y[2]);
		ObjEffect_SetVertexUV(obj, 3, GetClipMaxX, Y[3]-(X[3]-GetClipMaxX)*tan(CAngle+90+CDAngle-90));
		}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
///////////隣の頂点の二つがＸ座標、Ｙ座標違いででシーン外にあり、シーン端が写真内にない場合/////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////		
		if(X[0]<GetClipMinX && Y[1]<GetClipMinY && Y[0]+(X[0]-GetClipMinX)/tan(CAngle-180+CDAngle-90)>GetClipMinY)
		{
		ObjEffect_CreateVertex(obj, 6);
		ObjEffect_SetVertexXY(obj, 0, -PX, -PY-(X[0]-GetClipMinX)/cos(CAngle-180+CDAngle-90));
		ObjEffect_SetVertexXY(obj, 1, -PX-(X[0]-GetClipMinX)/sin(CAngle-180+CDAngle-90), -PY);
		ObjEffect_SetVertexXY(obj, 2, PX+(Y[1]-GetClipMinY)/cos(CAngle-180+CDAngle-90),  -PY);
		ObjEffect_SetVertexXY(obj, 3, PX, -PY-(Y[1]-GetClipMinY)/sin(CAngle-180+CDAngle-90));
		ObjEffect_SetVertexXY(obj, 4, PX, PY);
		ObjEffect_SetVertexXY(obj, 5,  -PX,  PY);
		
		ObjEffect_SetVertexUV(obj, 0,  GetClipMinX,  Y[0]-(X[0]-GetClipMinX)*tan(CAngle-180+CDAngle-90));
		ObjEffect_SetVertexUV(obj, 1,  GetClipMinX,  Y[0]+(X[0]-GetClipMinX)/tan(CAngle-180+CDAngle-90));
		ObjEffect_SetVertexUV(obj, 2,  X[1]+(Y[1]-GetClipMinY)*tan(CAngle-180+CDAngle-90),  GetClipMinY);
		ObjEffect_SetVertexUV(obj, 3,  X[1]-(Y[1]-GetClipMinY)/tan(CAngle-180+CDAngle-90),  GetClipMinY);
		ObjEffect_SetVertexUV(obj, 4, X[2],  Y[2]);
		ObjEffect_SetVertexUV(obj, 5, X[3], Y[3]);
		}

		if(X[1]<GetClipMinX && Y[2]<GetClipMinY && Y[1]+(X[1]-GetClipMinX)/tan(CAngle-90+CDAngle-90)>GetClipMinY)
		{
		ObjEffect_CreateVertex(obj, 6);

		ObjEffect_SetVertexXY(obj, 0, -PX, -PY);
		ObjEffect_SetVertexXY(obj, 1, PX+(X[1]-GetClipMinX)/cos(CAngle-90+CDAngle-90),  -PY);
		ObjEffect_SetVertexXY(obj, 2, PX,  -PY-(X[1]-GetClipMinX)/sin(CAngle-90+CDAngle-90));
		ObjEffect_SetVertexXY(obj, 3, PX, PY+(Y[2]-GetClipMinY)/sin(360-CAngle-180-CDAngle+90));
		ObjEffect_SetVertexXY(obj, 4, PX+(Y[2]-GetClipMinY)/cos(360-CAngle-180-CDAngle+90), PY);
		ObjEffect_SetVertexXY(obj, 5,  -PX,  PY);
		
		ObjEffect_SetVertexUV(obj, 0,  X[0],  Y[0]);
		ObjEffect_SetVertexUV(obj, 1,  GetClipMinX, Y[1]-(X[1]-GetClipMinX)*tan(CAngle-90+CDAngle-90));
		ObjEffect_SetVertexUV(obj, 2,  GetClipMinX, Y[1]+(X[1]-GetClipMinX)/tan(CAngle-90+CDAngle-90));
		ObjEffect_SetVertexUV(obj, 3, X[2]+(Y[2]-GetClipMinY)/tan(360-CAngle-180-CDAngle+90),  GetClipMinY);
		ObjEffect_SetVertexUV(obj, 4, X[2]-(Y[2]-GetClipMinY)*tan(360-CAngle-180-CDAngle+90),  GetClipMinY);
		ObjEffect_SetVertexUV(obj, 5, X[3], Y[3]);
		}

		if(X[2]<GetClipMinX && Y[3]<GetClipMinY && Y[2]+(X[2]-GetClipMinX)/tan(CAngle+CDAngle-90)>GetClipMinY)
		{
		ObjEffect_CreateVertex(obj, 6);

		ObjEffect_SetVertexXY(obj, 0, -PX, -PY);
		ObjEffect_SetVertexXY(obj, 1, PX,  -PY);
		ObjEffect_SetVertexXY(obj, 2, PX, PY+(X[2]-GetClipMinX)/cos(CAngle+CDAngle-90));
		ObjEffect_SetVertexXY(obj, 3, PX+(X[2]-GetClipMinX)/sin(CAngle+CDAngle-90), PY);
		ObjEffect_SetVertexXY(obj, 4,  -PX-(Y[3]-GetClipMinY)/cos(CAngle-360+CDAngle-90),  PY);
		ObjEffect_SetVertexXY(obj, 5,  -PX,  PY+(Y[3]-GetClipMinY)/sin(CAngle-360+CDAngle-90));
		
		ObjEffect_SetVertexUV(obj, 0,  X[0],  Y[0]);
		ObjEffect_SetVertexUV(obj, 1,  X[1], Y[1]);
		ObjEffect_SetVertexUV(obj, 2, GetClipMinX,  Y[2]-(X[2]-GetClipMinX)*tan(CAngle+CDAngle-90));
		ObjEffect_SetVertexUV(obj, 3, GetClipMinX,  Y[2]+(X[2]-GetClipMinX)/tan(CAngle+CDAngle-90));
		ObjEffect_SetVertexUV(obj, 4, X[3]+(Y[3]-GetClipMinY)*tan(CAngle-180+CDAngle-90),  GetClipMinY);
		ObjEffect_SetVertexUV(obj, 5, X[3]-(Y[3]-GetClipMinY)/tan(CAngle-180+CDAngle-90),  GetClipMinY);
		}

		if(X[3]<GetClipMinX && Y[0]<GetClipMinY && Y[3]+(X[3]-GetClipMinX)/tan(CAngle-270+CDAngle-90)>GetClipMinY)
		{
		ObjEffect_CreateVertex(obj, 6);

		ObjEffect_SetVertexXY(obj, 0, -PX,-PY-(Y[0]-GetClipMinY)/sin(360-CAngle-CDAngle+90));
		ObjEffect_SetVertexXY(obj, 1, -PX-(Y[0]-GetClipMinY)/cos(360-CAngle-CDAngle+90), -PY);
		ObjEffect_SetVertexXY(obj, 2, PX,  -PY);
		ObjEffect_SetVertexXY(obj, 3, PX, PY);
		ObjEffect_SetVertexXY(obj, 4,  -PX-(X[3]-GetClipMinX)/cos(CAngle-270+CDAngle-90),  PY);
		ObjEffect_SetVertexXY(obj, 5,  -PX,  PY+(X[3]-GetClipMinX)/sin(CAngle-270+CDAngle-90));
		
		ObjEffect_SetVertexUV(obj, 0,  X[0]+(Y[0]-GetClipMinY)/tan(360-CAngle-CDAngle+90),  GetClipMinY);
		ObjEffect_SetVertexUV(obj, 1,  X[0]-(Y[0]-GetClipMinY)*tan(360-CAngle-CDAngle+90),  GetClipMinY);
		ObjEffect_SetVertexUV(obj, 2,  X[1], Y[1]);
		ObjEffect_SetVertexUV(obj, 3, X[2],  Y[2]);
		ObjEffect_SetVertexUV(obj, 4, GetClipMinX, Y[3]-(X[3]-GetClipMinX)*tan(CAngle-270+CDAngle-90));
		ObjEffect_SetVertexUV(obj, 5, GetClipMinX, Y[3]+(X[3]-GetClipMinX)/tan(CAngle-270+CDAngle-90));
		}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
		if(Y[0]<GetClipMinY && X[1]>GetClipMaxX && X[0]-(Y[0]-GetClipMinY)*tan(360-CAngle-CDAngle+90)<GetClipMaxX)
		{
		ObjEffect_CreateVertex(obj, 6);

		ObjEffect_SetVertexXY(obj, 0, -PX,-PY-(Y[0]-GetClipMinY)/sin(360-CAngle-CDAngle+90));
		ObjEffect_SetVertexXY(obj, 1, -PX-(Y[0]-GetClipMinY)/cos(360-CAngle-CDAngle+90), -PY);
		ObjEffect_SetVertexXY(obj, 2, PX+(X[1]-GetClipMaxX)/cos(CAngle-90+CDAngle-90),  -PY);
		ObjEffect_SetVertexXY(obj, 3, PX,  -PY-(X[1]-GetClipMaxX)/sin(CAngle-90+CDAngle-90));
		ObjEffect_SetVertexXY(obj, 4, PX, PY);
		ObjEffect_SetVertexXY(obj, 5,  -PX,  PY);
		
		ObjEffect_SetVertexUV(obj, 0,  X[0]+(Y[0]-GetClipMinY)/tan(360-CAngle-CDAngle+90),  GetClipMinY);
		ObjEffect_SetVertexUV(obj, 1, X[0]-(Y[0]-GetClipMinY)*tan(360-CAngle-CDAngle+90),  GetClipMinY);
		ObjEffect_SetVertexUV(obj, 2,  GetClipMaxX, Y[1]-(X[1]-GetClipMaxX)*tan(CAngle-90+CDAngle-90));
		ObjEffect_SetVertexUV(obj, 3,  GetClipMaxX, Y[1]+(X[1]-GetClipMaxX)/tan(CAngle-90+CDAngle-90));
		ObjEffect_SetVertexUV(obj, 4, X[2],  Y[2]);
		ObjEffect_SetVertexUV(obj, 5, X[3], Y[3]);
		}

		if(Y[1]<GetClipMinY && X[2]>GetClipMaxX && X[1]-(Y[1]-GetClipMinY)/tan(CAngle-180+CDAngle-90)<GetClipMaxX)
		{
		ObjEffect_CreateVertex(obj, 6);

		ObjEffect_SetVertexXY(obj, 0, -PX, -PY);
		ObjEffect_SetVertexXY(obj, 1, PX+(Y[1]-GetClipMinY)/cos(CAngle-180+CDAngle-90),  -PY);
		ObjEffect_SetVertexXY(obj, 2, PX, -PY-(Y[1]-GetClipMinY)/sin(CAngle-180+CDAngle-90));
		ObjEffect_SetVertexXY(obj, 3, PX, PY+(X[2]-GetClipMaxX)/cos(CAngle+CDAngle-90));
		ObjEffect_SetVertexXY(obj, 4, PX+(X[2]-GetClipMaxX)/sin(CAngle+CDAngle-90), PY);
		ObjEffect_SetVertexXY(obj, 5,  -PX,  PY);
		
		ObjEffect_SetVertexUV(obj, 0,  X[0],  Y[0]);
		ObjEffect_SetVertexUV(obj, 1,  X[1]+(Y[1]-GetClipMinY)*tan(CAngle-180+CDAngle-90),  GetClipMinY);
		ObjEffect_SetVertexUV(obj, 2,  X[1]-(Y[1]-GetClipMinY)/tan(CAngle-180+CDAngle-90),  GetClipMinY);
		ObjEffect_SetVertexUV(obj, 3, GetClipMaxX,  Y[2]-(X[2]-GetClipMaxX)*tan(CAngle+CDAngle-90));
		ObjEffect_SetVertexUV(obj, 4, GetClipMaxX,  Y[2]+(X[2]-GetClipMaxX)/tan(CAngle+CDAngle-90));
		ObjEffect_SetVertexUV(obj, 5, X[3], Y[3]);
		}

		if(Y[2]<GetClipMinY && X[3]>GetClipMaxX && X[2]-(Y[2]-GetClipMinY)/tan(CAngle-180+CDAngle-90)<GetClipMaxX)
		{
		ObjEffect_CreateVertex(obj, 6);

		ObjEffect_SetVertexXY(obj, 0, -PX, -PY);
		ObjEffect_SetVertexXY(obj, 1, PX,  -PY);
		ObjEffect_SetVertexXY(obj, 2, PX, PY+(Y[2]-GetClipMinY)/sin(360-CAngle-180-CDAngle+90));
		ObjEffect_SetVertexXY(obj, 3, PX+(Y[2]-GetClipMinY)/cos(360-CAngle-180-CDAngle+90), PY);
		ObjEffect_SetVertexXY(obj, 4,  -PX-(X[3]-GetClipMaxX)/cos(CAngle-270+CDAngle-90),  PY);
		ObjEffect_SetVertexXY(obj, 5,  -PX,  PY+(X[3]-GetClipMaxX)/sin(CAngle-270+CDAngle-90));
		
		ObjEffect_SetVertexUV(obj, 0,  X[0],  Y[0]);
		ObjEffect_SetVertexUV(obj, 1,  X[1], Y[1]);
		ObjEffect_SetVertexUV(obj, 2, X[2]+(Y[2]-GetClipMinY)/tan(360-CAngle-180-CDAngle+90),  GetClipMinY);
		ObjEffect_SetVertexUV(obj, 3, X[2]-(Y[2]-GetClipMinY)*tan(360-CAngle-180-CDAngle+90),  GetClipMinY);
		ObjEffect_SetVertexUV(obj, 4, GetClipMaxX, Y[3]-(X[3]-GetClipMaxX)*tan(CAngle-270+CDAngle-90));
		ObjEffect_SetVertexUV(obj, 5, GetClipMaxX, Y[3]+(X[3]-GetClipMaxX)/tan(CAngle-270+CDAngle-90));
		}

		if(Y[3]<GetClipMinY && X[0]>GetClipMaxX && X[3]-(Y[3]-GetClipMinY)/tan(CAngle-180+CDAngle-90)<GetClipMaxX)
		{
		ObjEffect_CreateVertex(obj, 6);

		ObjEffect_SetVertexXY(obj, 0, -PX, -PY-(X[0]-GetClipMaxX)/cos(CAngle-180+CDAngle-90));
		ObjEffect_SetVertexXY(obj, 1, -PX-(X[0]-GetClipMaxX)/sin(CAngle-180+CDAngle-90), -PY);
		ObjEffect_SetVertexXY(obj, 2, PX,  -PY);
		ObjEffect_SetVertexXY(obj, 3, PX, PY);
		ObjEffect_SetVertexXY(obj, 4,  -PX-(Y[3]-GetClipMinY)/cos(CAngle-360+CDAngle-90),  PY);
		ObjEffect_SetVertexXY(obj, 5,  -PX,  PY+(Y[3]-GetClipMinY)/sin(CAngle-360+CDAngle-90));
		
		ObjEffect_SetVertexUV(obj, 0,  GetClipMaxX,  Y[0]-(X[0]-GetClipMaxX)*tan(CAngle-180+CDAngle-90));
		ObjEffect_SetVertexUV(obj, 1,  GetClipMaxX,  Y[0]+(X[0]-GetClipMaxX)/tan(CAngle-180+CDAngle-90));
		ObjEffect_SetVertexUV(obj, 2,  X[1], Y[1]);
		ObjEffect_SetVertexUV(obj, 3, X[2],  Y[2]);
		ObjEffect_SetVertexUV(obj, 4, X[3]+(Y[3]-GetClipMinY)*tan(CAngle-180+CDAngle-90),  GetClipMinY);
		ObjEffect_SetVertexUV(obj, 5, X[3]-(Y[3]-GetClipMinY)/tan(CAngle-180+CDAngle-90),  GetClipMinY);
		}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
		if(X[0]>GetClipMaxX && Y[1]>GetClipMaxY && Y[0]-(X[0]-GetClipMaxX)*tan(CAngle-180+CDAngle-90)<GetClipMaxY)
		{
		ObjEffect_CreateVertex(obj, 6);

		ObjEffect_SetVertexXY(obj, 0, -PX, -PY-(X[0]-GetClipMaxX)/cos(CAngle-180+CDAngle-90));
		ObjEffect_SetVertexXY(obj, 1, -PX-(X[0]-GetClipMaxX)/sin(CAngle-180+CDAngle-90), -PY);
		ObjEffect_SetVertexXY(obj, 2, PX+(Y[1]-GetClipMaxY)/cos(CAngle-180+CDAngle-90),  -PY);
		ObjEffect_SetVertexXY(obj, 3, PX, -PY-(Y[1]-GetClipMaxY)/sin(CAngle-180+CDAngle-90));
		ObjEffect_SetVertexXY(obj, 4, PX, PY);
		ObjEffect_SetVertexXY(obj, 5,  -PX,  PY);
		
		ObjEffect_SetVertexUV(obj, 0,  GetClipMaxX,  Y[0]-(X[0]-GetClipMaxX)*tan(CAngle-180+CDAngle-90));
		ObjEffect_SetVertexUV(obj, 1,  GetClipMaxX,  Y[0]+(X[0]-GetClipMaxX)/tan(CAngle-180+CDAngle-90));
		ObjEffect_SetVertexUV(obj, 2,  X[1]+(Y[1]-GetClipMaxY)*tan(CAngle-180+CDAngle-90),  GetClipMaxY);
		ObjEffect_SetVertexUV(obj, 3,  X[1]-(Y[1]-GetClipMaxY)/tan(CAngle-180+CDAngle-90),  GetClipMaxY);
		ObjEffect_SetVertexUV(obj, 4, X[2],  Y[2]);
		ObjEffect_SetVertexUV(obj, 5, X[3], Y[3]);
		}

		if(X[1]>GetClipMaxX && Y[2]>GetClipMaxY && Y[1]-(X[1]-GetClipMaxX)*tan(CAngle-180+CDAngle-90)<GetClipMaxY)
		{
		ObjEffect_CreateVertex(obj, 6);

		ObjEffect_SetVertexXY(obj, 0, -PX, -PY);
		ObjEffect_SetVertexXY(obj, 1, PX+(X[1]-GetClipMaxX)/cos(CAngle-90+CDAngle-90),  -PY);
		ObjEffect_SetVertexXY(obj, 2, PX,  -PY-(X[1]-GetClipMaxX)/sin(CAngle-90+CDAngle-90));
		ObjEffect_SetVertexXY(obj, 3, PX, PY+(Y[2]-GetClipMaxY)/sin(360-CAngle-180-CDAngle+90));
		ObjEffect_SetVertexXY(obj, 4, PX+(Y[2]-GetClipMaxY)/cos(360-CAngle-180-CDAngle+90), PY);
		ObjEffect_SetVertexXY(obj, 5,  -PX,  PY);
		
		ObjEffect_SetVertexUV(obj, 0,  X[0],  Y[0]);
		ObjEffect_SetVertexUV(obj, 1,  GetClipMaxX, Y[1]-(X[1]-GetClipMaxX)*tan(CAngle-90+CDAngle-90));
		ObjEffect_SetVertexUV(obj, 2,  GetClipMaxX, Y[1]+(X[1]-GetClipMaxX)/tan(CAngle-90+CDAngle-90));
		ObjEffect_SetVertexUV(obj, 3, X[2]+(Y[2]-GetClipMaxY)/tan(360-CAngle-180-CDAngle+90),  GetClipMaxY);
		ObjEffect_SetVertexUV(obj, 4, X[2]-(Y[2]-GetClipMaxY)*tan(360-CAngle-180-CDAngle+90),  GetClipMaxY);
		ObjEffect_SetVertexUV(obj, 5, X[3], Y[3]);
		}

		if(X[2]>GetClipMaxX && Y[3]>GetClipMaxY && Y[2]-(X[2]-GetClipMaxX)*tan(CAngle-180+CDAngle-90)<GetClipMaxY)
		{
		ObjEffect_CreateVertex(obj, 6);

		ObjEffect_SetVertexXY(obj, 0, -PX, -PY);
		ObjEffect_SetVertexXY(obj, 1, PX,  -PY);
		ObjEffect_SetVertexXY(obj, 2, PX, PY+(X[2]-GetClipMaxX)/cos(CAngle+CDAngle-90));
		ObjEffect_SetVertexXY(obj, 3, PX+(X[2]-GetClipMaxX)/sin(CAngle+CDAngle-90), PY);
		ObjEffect_SetVertexXY(obj, 4,  -PX-(Y[3]-GetClipMaxY)/cos(CAngle-360+CDAngle-90),  PY);
		ObjEffect_SetVertexXY(obj, 5,  -PX,  PY+(Y[3]-GetClipMaxY)/sin(CAngle-360+CDAngle-90));
		
		ObjEffect_SetVertexUV(obj, 0,  X[0],  Y[0]);
		ObjEffect_SetVertexUV(obj, 1,  X[1], Y[1]);
		ObjEffect_SetVertexUV(obj, 2, GetClipMaxX,  Y[2]-(X[2]-GetClipMaxX)*tan(CAngle+CDAngle-90));
		ObjEffect_SetVertexUV(obj, 3, GetClipMaxX,  Y[2]+(X[2]-GetClipMaxX)/tan(CAngle+CDAngle-90));
		ObjEffect_SetVertexUV(obj, 4, X[3]+(Y[3]-GetClipMaxY)*tan(CAngle-180+CDAngle-90),  GetClipMaxY);
		ObjEffect_SetVertexUV(obj, 5, X[3]-(Y[3]-GetClipMaxY)/tan(CAngle-180+CDAngle-90),  GetClipMaxY);
		}

		if(X[3]>GetClipMaxX && Y[0]>GetClipMaxY && Y[3]-(X[3]-GetClipMaxX)*tan(CAngle-180+CDAngle-90)<GetClipMaxY)
		{
		ObjEffect_CreateVertex(obj, 6);

		ObjEffect_SetVertexXY(obj, 0, -PX,-PY-(Y[0]-GetClipMaxY)/sin(360-CAngle-CDAngle+90));
		ObjEffect_SetVertexXY(obj, 1, -PX-(Y[0]-GetClipMaxY)/cos(360-CAngle-CDAngle+90), -PY);
		ObjEffect_SetVertexXY(obj, 2, PX,  -PY);
		ObjEffect_SetVertexXY(obj, 3, PX, PY);
		ObjEffect_SetVertexXY(obj, 4,  -PX-(X[3]-GetClipMaxX)/cos(CAngle-270+CDAngle-90),  PY);
		ObjEffect_SetVertexXY(obj, 5,  -PX,  PY+(X[3]-GetClipMaxX)/sin(CAngle-270+CDAngle-90));
		
		ObjEffect_SetVertexUV(obj, 0,  X[0]+(Y[0]-GetClipMaxY)/tan(360-CAngle-CDAngle+90),  GetClipMaxY);
		ObjEffect_SetVertexUV(obj, 1,  X[0]-(Y[0]-GetClipMaxY)*tan(360-CAngle-CDAngle+90),  GetClipMaxY);
		ObjEffect_SetVertexUV(obj, 2,  X[1], Y[1]);
		ObjEffect_SetVertexUV(obj, 3, X[2],  Y[2]);
		ObjEffect_SetVertexUV(obj, 4, GetClipMaxX, Y[3]-(X[3]-GetClipMaxX)*tan(CAngle-270+CDAngle-90));
		ObjEffect_SetVertexUV(obj, 5, GetClipMaxX, Y[3]+(X[3]-GetClipMaxX)/tan(CAngle-270+CDAngle-90));
		}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
		if(Y[0]>GetClipMaxY && X[1]<GetClipMinX && X[0]+(Y[0]-GetClipMaxY)/tan(360-CAngle-CDAngle+90)>GetClipMinX)
		{
		ObjEffect_CreateVertex(obj, 6);

		ObjEffect_SetVertexXY(obj, 0, -PX,-PY-(Y[0]-GetClipMaxY)/sin(360-CAngle-CDAngle+90));
		ObjEffect_SetVertexXY(obj, 1, -PX-(Y[0]-GetClipMaxY)/cos(360-CAngle-CDAngle+90), -PY);
		ObjEffect_SetVertexXY(obj, 2, PX+(X[1]-GetClipMinX)/cos(CAngle-90+CDAngle-90),  -PY);
		ObjEffect_SetVertexXY(obj, 3, PX,  -PY-(X[1]-GetClipMinX)/sin(CAngle-90+CDAngle-90));
		ObjEffect_SetVertexXY(obj, 4, PX, PY);
		ObjEffect_SetVertexXY(obj, 5,  -PX,  PY);
		
		ObjEffect_SetVertexUV(obj, 0,  X[0]+(Y[0]-GetClipMaxY)/tan(360-CAngle-CDAngle+90),  GetClipMaxY);
		ObjEffect_SetVertexUV(obj, 1,  X[0]-(Y[0]-GetClipMaxY)*tan(360-CAngle-CDAngle+90),  GetClipMaxY);
		ObjEffect_SetVertexUV(obj, 2,  GetClipMinX, Y[1]-(X[1]-GetClipMinX)*tan(CAngle-90+CDAngle-90));
		ObjEffect_SetVertexUV(obj, 3,  GetClipMinX, Y[1]+(X[1]-GetClipMinX)/tan(CAngle-90+CDAngle-90));
		ObjEffect_SetVertexUV(obj, 4, X[2],  Y[2]);
		ObjEffect_SetVertexUV(obj, 5, X[3], Y[3]);
		}

		if(Y[1]>GetClipMaxY && X[2]<GetClipMinX && X[1]+(Y[1]-GetClipMaxY)/tan(360-CAngle-CDAngle+90)>GetClipMinX)
		{
		ObjEffect_CreateVertex(obj, 6);

		ObjEffect_SetVertexXY(obj, 0, -PX, -PY);
		ObjEffect_SetVertexXY(obj, 1, PX+(Y[1]-GetClipMaxY)/cos(CAngle-180+CDAngle-90),  -PY);
		ObjEffect_SetVertexXY(obj, 2, PX, -PY-(Y[1]-GetClipMaxY)/sin(CAngle-180+CDAngle-90));
		ObjEffect_SetVertexXY(obj, 3, PX, PY+(X[2]-GetClipMinX)/cos(CAngle+CDAngle-90));
		ObjEffect_SetVertexXY(obj, 4, PX+(X[2]-GetClipMinX)/sin(CAngle+CDAngle-90), PY);
		ObjEffect_SetVertexXY(obj, 5,  -PX,  PY);
		
		ObjEffect_SetVertexUV(obj, 0,  X[0],  Y[0]);
		ObjEffect_SetVertexUV(obj, 1,  X[1]+(Y[1]-GetClipMaxY)*tan(CAngle-180+CDAngle-90),  GetClipMaxY);
		ObjEffect_SetVertexUV(obj, 2,  X[1]-(Y[1]-GetClipMaxY)/tan(CAngle-180+CDAngle-90),  GetClipMaxY);
		ObjEffect_SetVertexUV(obj, 3, GetClipMinX,  Y[2]-(X[2]-GetClipMinX)*tan(CAngle+CDAngle-90));
		ObjEffect_SetVertexUV(obj, 4, GetClipMinX,  Y[2]+(X[2]-GetClipMinX)/tan(CAngle+CDAngle-90));
		ObjEffect_SetVertexUV(obj, 5, X[3], Y[3]);
		}

		if(Y[2]>GetClipMaxY && X[3]<GetClipMinX && X[2]+(Y[2]-GetClipMaxY)/tan(360-CAngle-CDAngle+90)>GetClipMinX)
		{
		ObjEffect_CreateVertex(obj, 6);

		ObjEffect_SetVertexXY(obj, 0, -PX, -PY);
		ObjEffect_SetVertexXY(obj, 1, PX,  -PY);
		ObjEffect_SetVertexXY(obj, 2, PX, PY+(Y[2]-GetClipMaxY)/sin(360-CAngle-180-CDAngle+90));
		ObjEffect_SetVertexXY(obj, 3, PX+(Y[2]-GetClipMaxY)/cos(360-CAngle-180-CDAngle+90), PY);
		ObjEffect_SetVertexXY(obj, 4,  -PX-(X[3]-GetClipMinX)/cos(CAngle-270+CDAngle-90),  PY);
		ObjEffect_SetVertexXY(obj, 5,  -PX,  PY+(X[3]-GetClipMinX)/sin(CAngle-270+CDAngle-90));
		
		ObjEffect_SetVertexUV(obj, 0,  X[0],  Y[0]);
		ObjEffect_SetVertexUV(obj, 1,  X[1], Y[1]);
		ObjEffect_SetVertexUV(obj, 2, X[2]+(Y[2]-GetClipMaxY)/tan(360-CAngle-180-CDAngle+90),  GetClipMaxY);
		ObjEffect_SetVertexUV(obj, 3, X[2]-(Y[2]-GetClipMaxY)*tan(360-CAngle-180-CDAngle+90),  GetClipMaxY);
		ObjEffect_SetVertexUV(obj, 4, GetClipMinX, Y[3]-(X[3]-GetClipMinX)*tan(CAngle-270+CDAngle-90));
		ObjEffect_SetVertexUV(obj, 5, GetClipMinX, Y[3]+(X[3]-GetClipMinX)/tan(CAngle-270+CDAngle-90));
		}

		if(Y[3]>GetClipMaxY && X[0]<GetClipMinX && X[3]+(Y[3]-GetClipMaxY)/tan(360-CAngle-CDAngle+90)>GetClipMinX)
		{
		ObjEffect_CreateVertex(obj, 6);

		ObjEffect_SetVertexXY(obj, 0, -PX, -PY-(X[0]-GetClipMinX)/cos(CAngle-180+CDAngle-90));
		ObjEffect_SetVertexXY(obj, 1, -PX-(X[0]-GetClipMinX)/sin(CAngle-180+CDAngle-90), -PY);
		ObjEffect_SetVertexXY(obj, 2, PX,  -PY);
		ObjEffect_SetVertexXY(obj, 3, PX, PY);
		ObjEffect_SetVertexXY(obj, 4,  -PX-(Y[3]-GetClipMaxY)/cos(CAngle-360+CDAngle-90),  PY);
		ObjEffect_SetVertexXY(obj, 5,  -PX,  PY+(Y[3]-GetClipMaxY)/sin(CAngle-360+CDAngle-90));
		
		ObjEffect_SetVertexUV(obj, 0,  GetClipMinX,  Y[0]-(X[0]-GetClipMinX)*tan(CAngle-180+CDAngle-90));
		ObjEffect_SetVertexUV(obj, 1,  GetClipMinX,  Y[0]+(X[0]-GetClipMinX)/tan(CAngle-180+CDAngle-90));
		ObjEffect_SetVertexUV(obj, 2,  X[1], Y[1]);
		ObjEffect_SetVertexUV(obj, 3, X[2],  Y[2]);
		ObjEffect_SetVertexUV(obj, 4, X[3]+(Y[3]-GetClipMaxY)*tan(CAngle-180+CDAngle-90),  GetClipMaxY);
		ObjEffect_SetVertexUV(obj, 5, X[3]-(Y[3]-GetClipMaxY)/tan(CAngle-180+CDAngle-90),  GetClipMaxY);
		}

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
///////////隣の頂点の二つがＸ座標、Ｙ座標違いででシーン外にあり、シーン端が写真内にある場合/////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
if(Difined==false)
{
		if(X[0]<GetClipMinX && Y[1]<GetClipMinY && Y[0]+(X[0]-GetClipMinX)/tan(CAngle-180+CDAngle-90)<=GetClipMinY)
		{
		ObjEffect_CreateVertex(obj, 5);

		ObjEffect_SetVertexXY(obj, 0, -PX, -PY-(X[0]-GetClipMinX)/cos(CAngle-180+CDAngle-90));
		ObjEffect_SetVertexXY(obj, 1, OriDis1*sin(OriAngle1-90+CAngle-180+CDAngle-90),OriDis1*cos(OriAngle1-90+CAngle-180+CDAngle-90));
		ObjEffect_SetVertexXY(obj, 2, PX,  -PY-(Y[1]-GetClipMinY)/sin(CAngle-180+CDAngle-90));
		ObjEffect_SetVertexXY(obj, 3, PX, PY);
		ObjEffect_SetVertexXY(obj, 4,  -PX,  PY);
		
		ObjEffect_SetVertexUV(obj, 0, GetClipMinX,  Y[0]-(X[0]-GetClipMinX)*tan(CAngle-180+CDAngle-90));
		ObjEffect_SetVertexUV(obj, 1,  GetClipMinX, GetClipMinY);
		ObjEffect_SetVertexUV(obj, 2,  X[1]-(Y[1]-GetClipMinY)/tan(CAngle-180+CDAngle-90),  GetClipMinY);
		ObjEffect_SetVertexUV(obj, 3, X[2],  Y[2]);
		ObjEffect_SetVertexUV(obj, 4, X[3], Y[3]);
		}

		if(X[1]<GetClipMinX && Y[2]<GetClipMinY && Y[1]+(X[1]-GetClipMinX)/tan(CAngle-90+CDAngle-90)<=GetClipMinY)
		{
		ObjEffect_CreateVertex(obj, 5);

		ObjEffect_SetVertexXY(obj, 0, -PX, -PY);
		ObjEffect_SetVertexXY(obj, 1, PX+(X[1]-GetClipMinX)/cos(CAngle-90+CDAngle-90),  -PY);
		ObjEffect_SetVertexXY(obj, 2, OriDis1*sin(OriAngle1-90+CAngle-180+CDAngle-90),OriDis1*cos(OriAngle1-90+CAngle-180+CDAngle-90));
		ObjEffect_SetVertexXY(obj, 3, PX+(Y[2]-GetClipMinY)/cos(360-CAngle-180-CDAngle+90), PY);
		ObjEffect_SetVertexXY(obj, 4,  -PX,  PY);
		
		ObjEffect_SetVertexUV(obj, 0,  X[0],  Y[0]);
		ObjEffect_SetVertexUV(obj, 1,  GetClipMinX, Y[1]-(X[1]-GetClipMinX)*tan(CAngle-90+CDAngle-90));
		ObjEffect_SetVertexUV(obj, 2,  GetClipMinX, GetClipMinY);
		ObjEffect_SetVertexUV(obj, 3, X[2]-(Y[2]-GetClipMinY)*tan(360-CAngle-180-CDAngle+90),  GetClipMinY);
		ObjEffect_SetVertexUV(obj, 4, X[3], Y[3]);
		}

		if(X[2]<GetClipMinX && Y[3]<GetClipMinY && Y[2]+(X[2]-GetClipMinX)/tan(CAngle+CDAngle-90)<=GetClipMinY)
		{
		ObjEffect_CreateVertex(obj, 5);

		ObjEffect_SetVertexXY(obj, 0, -PX, -PY);
		ObjEffect_SetVertexXY(obj, 1, PX,  -PY);
		ObjEffect_SetVertexXY(obj, 2, PX, PY+(X[2]-GetClipMinX)/cos(CAngle+CDAngle-90));
		ObjEffect_SetVertexXY(obj, 3, OriDis1*sin(OriAngle1-90+CAngle-180+CDAngle-90),OriDis1*cos(OriAngle1-90+CAngle-180+CDAngle-90));	
		ObjEffect_SetVertexXY(obj, 4,  -PX,  PY+(Y[3]-GetClipMinY)/sin(CAngle-360+CDAngle-90));
		
		ObjEffect_SetVertexUV(obj, 0,  X[0],  Y[0]);
		ObjEffect_SetVertexUV(obj, 1,  X[1], Y[1]);
		ObjEffect_SetVertexUV(obj, 2, GetClipMinX,  Y[2]-(X[2]-GetClipMinX)*tan(CAngle+CDAngle-90));
		ObjEffect_SetVertexUV(obj, 3,  GetClipMinX, GetClipMinY);
		ObjEffect_SetVertexUV(obj, 4, X[3]-(Y[3]-GetClipMinY)/tan(CAngle-180+CDAngle-90),  GetClipMinY);
		}

		if(X[3]<GetClipMinX && Y[0]<GetClipMinY && Y[3]+(X[3]-GetClipMinX)/tan(CAngle-270+CDAngle-90)<=GetClipMinY)
		{
		ObjEffect_CreateVertex(obj, 5);

		ObjEffect_SetVertexXY(obj, 0, -PX-(Y[0]-GetClipMinY)/cos(360-CAngle-CDAngle+90), -PY);
		ObjEffect_SetVertexXY(obj, 1, PX,  -PY);
		ObjEffect_SetVertexXY(obj, 2, PX, PY);
		ObjEffect_SetVertexXY(obj, 3,  -PX-(X[3]-GetClipMinX)/cos(CAngle-270+CDAngle-90),  PY);
		ObjEffect_SetVertexXY(obj, 4, OriDis1*sin(OriAngle1-90+CAngle-180+CDAngle-90),OriDis1*cos(OriAngle1-90+CAngle-180+CDAngle-90));
		

		ObjEffect_SetVertexUV(obj, 0,  X[0]-(Y[0]-GetClipMinY)*tan(360-CAngle-CDAngle+90),  GetClipMinY);
		ObjEffect_SetVertexUV(obj, 1,  X[1], Y[1]);
		ObjEffect_SetVertexUV(obj, 2, X[2],  Y[2]);
		ObjEffect_SetVertexUV(obj, 3, GetClipMinX, Y[3]-(X[3]-GetClipMinX)*tan(CAngle-270+CDAngle-90));
		ObjEffect_SetVertexUV(obj, 4,  GetClipMinX, GetClipMinY);
		}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
		if(Y[0]<GetClipMinY && X[1]>GetClipMaxX && X[0]-(Y[0]-GetClipMinY)*tan(360-CAngle-CDAngle+90)>=GetClipMaxX)
		{
		ObjEffect_CreateVertex(obj, 5);

		ObjEffect_SetVertexXY(obj, 0, -PX,-PY-(Y[0]-GetClipMinY)/sin(360-CAngle-CDAngle+90));
		ObjEffect_SetVertexXY(obj, 1, OriDis2*sin(OriAngle2-90+CAngle-180+CDAngle-90),OriDis2*cos(OriAngle2-90+CAngle-180+CDAngle-90));
		ObjEffect_SetVertexXY(obj, 2, PX,  -PY-(X[1]-GetClipMaxX)/sin(CAngle-90+CDAngle-90));
		ObjEffect_SetVertexXY(obj, 3, PX, PY);
		ObjEffect_SetVertexXY(obj, 4,  -PX,  PY);
		
		ObjEffect_SetVertexUV(obj, 0,  X[0]+(Y[0]-GetClipMinY)/tan(360-CAngle-CDAngle+90),  GetClipMinY);
		ObjEffect_SetVertexUV(obj, 1,  GetClipMaxX, GetClipMinY);
		ObjEffect_SetVertexUV(obj, 2,  GetClipMaxX, Y[1]+(X[1]-GetClipMaxX)/tan(CAngle-90+CDAngle-90));
		ObjEffect_SetVertexUV(obj, 3, X[2],  Y[2]);
		ObjEffect_SetVertexUV(obj, 4, X[3], Y[3]);
		}

		if(Y[1]<GetClipMinY && X[2]>GetClipMaxX && X[1]-(Y[1]-GetClipMinY)/tan(CAngle-180+CDAngle-90)>=GetClipMaxX)
		{
		ObjEffect_CreateVertex(obj, 5);

		ObjEffect_SetVertexXY(obj, 0, -PX, -PY);
		ObjEffect_SetVertexXY(obj, 1, PX+(Y[1]-GetClipMinY)/cos(CAngle-180+CDAngle-90),  -PY);
		ObjEffect_SetVertexXY(obj, 2, OriDis2*sin(OriAngle2-90+CAngle-180+CDAngle-90),OriDis2*cos(OriAngle2-90+CAngle-180+CDAngle-90));
		ObjEffect_SetVertexXY(obj, 3, PX+(X[2]-GetClipMaxX)/sin(CAngle+CDAngle-90), PY);
		ObjEffect_SetVertexXY(obj, 4,  -PX,  PY);
	
		ObjEffect_SetVertexUV(obj, 0,  X[0],  Y[0]);
		ObjEffect_SetVertexUV(obj, 1,  X[1]+(Y[1]-GetClipMinY)*tan(CAngle-180+CDAngle-90),  GetClipMinY);
		ObjEffect_SetVertexUV(obj, 2,  GetClipMaxX, GetClipMinY);	
		ObjEffect_SetVertexUV(obj, 3, GetClipMaxX,  Y[2]+(X[2]-GetClipMaxX)/tan(CAngle+CDAngle-90));
		ObjEffect_SetVertexUV(obj, 4, X[3], Y[3]);
		}

		if(Y[2]<GetClipMinY && X[3]>GetClipMaxX && X[2]-(Y[2]-GetClipMinY)/tan(-(CAngle-180+CDAngle-90))>=GetClipMaxX)
		{
		ObjEffect_CreateVertex(obj, 5);

		ObjEffect_SetVertexXY(obj, 0, -PX, -PY);
		ObjEffect_SetVertexXY(obj, 1, PX,  -PY);
		ObjEffect_SetVertexXY(obj, 2, PX, PY+(Y[2]-GetClipMinY)/sin(360-CAngle-180-CDAngle+90));
		ObjEffect_SetVertexXY(obj, 3, OriDis2*sin(OriAngle2-90+CAngle-180+CDAngle-90),OriDis2*cos(OriAngle2-90+CAngle-180+CDAngle-90));
		ObjEffect_SetVertexXY(obj, 4,  -PX,  PY+(X[3]-GetClipMaxX)/sin(CAngle-270+CDAngle-90));
		
		ObjEffect_SetVertexUV(obj, 0,  X[0],  Y[0]);
		ObjEffect_SetVertexUV(obj, 1,  X[1], Y[1]);
		ObjEffect_SetVertexUV(obj, 2, X[2]+(Y[2]-GetClipMinY)/tan(360-CAngle-180-CDAngle+90),  GetClipMinY);
		ObjEffect_SetVertexUV(obj, 3,  GetClipMaxX, GetClipMinY);
		ObjEffect_SetVertexUV(obj, 4, GetClipMaxX, Y[3]+(X[3]-GetClipMaxX)/tan(CAngle-270+CDAngle-90));
		}

		if(Y[3]<GetClipMinY && X[0]>GetClipMaxX && X[3]-(Y[3]-GetClipMinY)/tan(CAngle-180+CDAngle-90)>=GetClipMaxX)
		{
		ObjEffect_CreateVertex(obj, 5);

		ObjEffect_SetVertexXY(obj, 0, -PX-(X[0]-GetClipMaxX)/sin(CAngle-180+CDAngle-90), -PY);
		ObjEffect_SetVertexXY(obj, 1, PX,  -PY);
		ObjEffect_SetVertexXY(obj, 2, PX, PY);
		ObjEffect_SetVertexXY(obj, 3,  -PX-(Y[3]-GetClipMinY)/cos(CAngle-360+CDAngle-90),  PY);
		ObjEffect_SetVertexXY(obj, 4, OriDis2*sin(OriAngle2-90+CAngle-180+CDAngle-90),OriDis2*cos(OriAngle2-90+CAngle-180+CDAngle-90));
		
		ObjEffect_SetVertexUV(obj, 0,  GetClipMaxX,  Y[0]+(X[0]-GetClipMaxX)/tan(CAngle-180+CDAngle-90));
		ObjEffect_SetVertexUV(obj, 1,  X[1], Y[1]);
		ObjEffect_SetVertexUV(obj, 2, X[2],  Y[2]);
		ObjEffect_SetVertexUV(obj, 3, X[3]+(Y[3]-GetClipMinY)*tan(CAngle-180+CDAngle-90),  GetClipMinY);
		ObjEffect_SetVertexUV(obj, 4,  GetClipMaxX, GetClipMinY);
		}

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
		if(X[0]>GetClipMaxX && Y[1]>GetClipMaxY && Y[0]+(X[0]-GetClipMaxX)*tan(CAngle-180+CDAngle-90)>=GetClipMaxY)
		{
		ObjEffect_CreateVertex(obj, 5);

		ObjEffect_SetVertexXY(obj, 0, -PX, -PY-(X[0]-GetClipMaxX)/cos(CAngle-180+CDAngle-90));
		ObjEffect_SetVertexXY(obj, 1, OriDis3*sin(OriAngle3-90+CAngle-180+CDAngle-90),OriDis3*cos(OriAngle3-90+CAngle-180+CDAngle-90));
		ObjEffect_SetVertexXY(obj, 2, PX, -PY-(Y[1]-GetClipMaxY)/sin(CAngle-180+CDAngle-90));
		ObjEffect_SetVertexXY(obj, 3, PX, PY);
		ObjEffect_SetVertexXY(obj, 4,  -PX,  PY);
		
		ObjEffect_SetVertexUV(obj, 0,  GetClipMaxX,  Y[0]-(X[0]-GetClipMaxX)*tan(CAngle-180+CDAngle-90));
		ObjEffect_SetVertexUV(obj, 1,  GetClipMaxX, GetClipMaxY);
		ObjEffect_SetVertexUV(obj, 2,  X[1]-(Y[1]-GetClipMaxY)/tan(CAngle-180+CDAngle-90),  GetClipMaxY);
		ObjEffect_SetVertexUV(obj, 3, X[2],  Y[2]);
		ObjEffect_SetVertexUV(obj, 4, X[3], Y[3]);
		}

		if(X[1]>GetClipMaxX && Y[2]>GetClipMaxY && Y[1]-(X[1]-GetClipMaxX)*tan(CAngle-180+CDAngle-90)>=GetClipMaxY)
		{

		ObjEffect_CreateVertex(obj, 5);

		ObjEffect_SetVertexXY(obj, 0, -PX, -PY);
		ObjEffect_SetVertexXY(obj, 1, PX+(X[1]-GetClipMaxX)/cos(CAngle-90+CDAngle-90),  -PY);
		ObjEffect_SetVertexXY(obj, 2, OriDis3*sin(OriAngle3-90+CAngle-180+CDAngle-90),OriDis3*cos(OriAngle3-90+CAngle-180+CDAngle-90));
		ObjEffect_SetVertexXY(obj, 3, PX+(Y[2]-GetClipMaxY)/cos(360-CAngle-180-CDAngle+90), PY);
		ObjEffect_SetVertexXY(obj, 4,  -PX,  PY);
		
		ObjEffect_SetVertexUV(obj, 0,  X[0],  Y[0]);
		ObjEffect_SetVertexUV(obj, 1,  GetClipMaxX, Y[1]-(X[1]-GetClipMaxX)*tan(CAngle-90+CDAngle-90));
		ObjEffect_SetVertexUV(obj, 2,  GetClipMaxX, GetClipMaxY);
		ObjEffect_SetVertexUV(obj, 3, X[2]-(Y[2]-GetClipMaxY)*tan(360-CAngle-180-CDAngle+90),  GetClipMaxY);
		ObjEffect_SetVertexUV(obj, 4, X[3], Y[3]);
		}

		if(X[2]>GetClipMaxX && Y[3]>GetClipMaxY && Y[2]+(X[2]-GetClipMaxX)*tan(CAngle-180+CDAngle-90)>=GetClipMaxY)
		{
		ObjEffect_CreateVertex(obj, 5);

		ObjEffect_SetVertexXY(obj, 0, -PX, -PY);
		ObjEffect_SetVertexXY(obj, 1, PX,  -PY);
		ObjEffect_SetVertexXY(obj, 2, PX, PY+(X[2]-GetClipMaxX)/cos(CAngle+CDAngle-90));
		ObjEffect_SetVertexXY(obj, 3, OriDis3*sin(OriAngle3-90+CAngle-180+CDAngle-90),OriDis3*cos(OriAngle3-90+CAngle-180+CDAngle-90));
		ObjEffect_SetVertexXY(obj, 4,  -PX,  PY+(Y[3]-GetClipMaxY)/sin(CAngle-360+CDAngle-90));
		
		ObjEffect_SetVertexUV(obj, 0,  X[0],  Y[0]);
		ObjEffect_SetVertexUV(obj, 1,  X[1], Y[1]);
		ObjEffect_SetVertexUV(obj, 2, GetClipMaxX,  Y[2]-(X[2]-GetClipMaxX)*tan(CAngle+CDAngle-90));
		ObjEffect_SetVertexUV(obj, 3,  GetClipMaxX, GetClipMaxY);
		ObjEffect_SetVertexUV(obj, 4, X[3]-(Y[3]-GetClipMaxY)/tan(CAngle-180+CDAngle-90),  GetClipMaxY);
		}

		if(X[3]>GetClipMaxX && Y[0]>GetClipMaxY && Y[3]-(X[3]-GetClipMaxX)*tan(CAngle-180+CDAngle-90)>=GetClipMaxY)
		{
		ObjEffect_CreateVertex(obj, 5);


		ObjEffect_SetVertexXY(obj, 0, -PX-(Y[0]-GetClipMaxY)/cos(360-CAngle-CDAngle+90), -PY);
		ObjEffect_SetVertexXY(obj, 1, PX,  -PY);
		ObjEffect_SetVertexXY(obj, 2, PX, PY);
		ObjEffect_SetVertexXY(obj, 3,  -PX-(X[3]-GetClipMaxX)/cos(CAngle-270+CDAngle-90),  PY);
		ObjEffect_SetVertexXY(obj, 4, OriDis3*sin(OriAngle3-90+CAngle-180+CDAngle-90),OriDis3*cos(OriAngle3-90+CAngle-180+CDAngle-90));
		
		ObjEffect_SetVertexUV(obj, 0,  X[0]-(Y[0]-GetClipMaxY)*tan(360-CAngle-CDAngle+90),  GetClipMaxY);
		ObjEffect_SetVertexUV(obj, 1,  X[1], Y[1]);
		ObjEffect_SetVertexUV(obj, 2, X[2],  Y[2]);
		ObjEffect_SetVertexUV(obj, 3, GetClipMaxX, Y[3]-(X[3]-GetClipMaxX)*tan(CAngle-270+CDAngle-90));
		ObjEffect_SetVertexUV(obj, 4,  GetClipMaxX, GetClipMaxY);
		}

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
		if(Y[0]>GetClipMaxY && X[1]<GetClipMinX && X[0]-(Y[0]-GetClipMaxY)/tan(360-CAngle-CDAngle+90)<=GetClipMinX)
		{
		ObjEffect_CreateVertex(obj, 5);

		ObjEffect_SetVertexXY(obj, 0, -PX,-PY-(Y[0]-GetClipMaxY)/sin(360-CAngle-CDAngle+90));
		ObjEffect_SetVertexXY(obj, 1, OriDis4*sin(OriAngle4-90+CAngle-180+CDAngle-90),OriDis4*cos(OriAngle4-90+CAngle-180+CDAngle-90));
		ObjEffect_SetVertexXY(obj, 2, PX,  -PY-(X[1]-GetClipMinX)/sin(CAngle-90+CDAngle-90));
		ObjEffect_SetVertexXY(obj, 3, PX, PY);
		ObjEffect_SetVertexXY(obj, 4,  -PX,  PY);
		
		ObjEffect_SetVertexUV(obj, 0,  X[0]+(Y[0]-GetClipMaxY)/tan(360-CAngle-CDAngle+90),  GetClipMaxY);
		ObjEffect_SetVertexUV(obj, 1,  GetClipMinX, GetClipMaxY);
		ObjEffect_SetVertexUV(obj, 2,  GetClipMinX, Y[1]+(X[1]-GetClipMinX)/tan(CAngle-90+CDAngle-90));
		ObjEffect_SetVertexUV(obj, 3, X[2],  Y[2]);
		ObjEffect_SetVertexUV(obj, 4, X[3], Y[3]);
		}

		if(Y[1]>GetClipMaxY && X[2]<GetClipMinX && X[1]+(Y[1]-GetClipMaxY)/tan(360-CAngle-CDAngle+90)<=GetClipMinX)
		{
		ObjEffect_CreateVertex(obj, 5);

		ObjEffect_SetVertexXY(obj, 0, -PX, -PY);
		ObjEffect_SetVertexXY(obj, 1, PX+(Y[1]-GetClipMaxY)/cos(CAngle-180+CDAngle-90),  -PY);
		ObjEffect_SetVertexXY(obj, 2, OriDis4*sin(OriAngle4-90+CAngle-180+CDAngle-90),OriDis4*cos(OriAngle4-90+CAngle-180+CDAngle-90));
		ObjEffect_SetVertexXY(obj, 3, PX+(X[2]-GetClipMinX)/sin(CAngle+CDAngle-90), PY);
		ObjEffect_SetVertexXY(obj, 4,  -PX,  PY);
		
		ObjEffect_SetVertexUV(obj, 0,  X[0],  Y[0]);
		ObjEffect_SetVertexUV(obj, 1,  X[1]+(Y[1]-GetClipMaxY)*tan(CAngle-180+CDAngle-90),  GetClipMaxY);
		ObjEffect_SetVertexUV(obj, 2,  GetClipMinX, GetClipMaxY);
		ObjEffect_SetVertexUV(obj, 3, GetClipMinX,  Y[2]+(X[2]-GetClipMinX)/tan(CAngle+CDAngle-90));
		ObjEffect_SetVertexUV(obj, 4, X[3], Y[3]);
		}

		if(Y[2]>GetClipMaxY && X[3]<GetClipMinX && X[2]-(Y[2]-GetClipMaxY)/tan(360-CAngle-CDAngle+90)<=GetClipMinX)
		{
		ObjEffect_CreateVertex(obj, 5);

		ObjEffect_SetVertexXY(obj, 0, -PX, -PY);
		ObjEffect_SetVertexXY(obj, 1, PX,  -PY);
		ObjEffect_SetVertexXY(obj, 2, PX, PY+(Y[2]-GetClipMaxY)/sin(360-CAngle-180-CDAngle+90));
		ObjEffect_SetVertexXY(obj, 3, OriDis4*sin(OriAngle4-90+CAngle-180+CDAngle-90),OriDis4*cos(OriAngle4-90+CAngle-180+CDAngle-90));
		ObjEffect_SetVertexXY(obj, 4,  -PX,  PY+(X[3]-GetClipMinX)/sin(CAngle-270+CDAngle-90));
		
		ObjEffect_SetVertexUV(obj, 0,  X[0],  Y[0]);
		ObjEffect_SetVertexUV(obj, 1,  X[1], Y[1]);
		ObjEffect_SetVertexUV(obj, 2, X[2]+(Y[2]-GetClipMaxY)/tan(360-CAngle-180-CDAngle+90),  GetClipMaxY);
		ObjEffect_SetVertexUV(obj, 3,  GetClipMinX, GetClipMaxY);
		ObjEffect_SetVertexUV(obj, 4, GetClipMinX, Y[3]+(X[3]-GetClipMinX)/tan(CAngle-270+CDAngle-90));
		}

		if(Y[3]>GetClipMaxY && X[0]<GetClipMinX && X[3]+(Y[3]-GetClipMaxY)/tan(360-CAngle-CDAngle+90)<=GetClipMinX)
		{
		ObjEffect_CreateVertex(obj, 5);


		ObjEffect_SetVertexXY(obj, 0, -PX-(X[0]-GetClipMinX)/sin(CAngle-180+CDAngle-90), -PY);
		ObjEffect_SetVertexXY(obj, 1, PX,  -PY);
		ObjEffect_SetVertexXY(obj, 2, PX, PY);
		ObjEffect_SetVertexXY(obj, 3,  -PX-(Y[3]-GetClipMaxY)/cos(CAngle-360+CDAngle-90),  PY);
		ObjEffect_SetVertexXY(obj, 4, OriDis4*sin(OriAngle4-90+CAngle-180+CDAngle-90),OriDis4*cos(OriAngle4-90+CAngle-180+CDAngle-90));
		

		ObjEffect_SetVertexUV(obj, 0,  GetClipMinX,  Y[0]+(X[0]-GetClipMinX)/tan(CAngle-180+CDAngle-90));
		ObjEffect_SetVertexUV(obj, 1,  X[1], Y[1]);
		ObjEffect_SetVertexUV(obj, 2, X[2],  Y[2]);
		ObjEffect_SetVertexUV(obj, 3, X[3]+(Y[3]-GetClipMaxY)*tan(CAngle-180+CDAngle-90),  GetClipMaxY);
		ObjEffect_SetVertexUV(obj, 4,  GetClipMinX, GetClipMaxY);
		}
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
///////////対角の頂点二つ（頂点の三つ）がシーン外にある場合、シーン内に端が入る場合。入らない状況はある？/////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
		if(Y[1]<GetClipMinY && X[3]<GetClipMinX)
		{
		ObjEffect_CreateVertex(obj, 4);

		ObjEffect_SetVertexXY(obj, 0, OriDis1*sin(OriAngle1+CAngle-180-90+CDAngle-90),OriDis1*cos(OriAngle1+CAngle-180-90+CDAngle-90));
		ObjEffect_SetVertexXY(obj, 1, PX,  -PY-(Y[1]-GetClipMinY)/sin(CAngle-180+CDAngle-90));
		ObjEffect_SetVertexXY(obj, 2, PX, PY);
		ObjEffect_SetVertexXY(obj, 3,  -PX-(X[3]-GetClipMinX)/cos(270-CAngle-CDAngle+90),  PY);
		
		ObjEffect_SetVertexUV(obj, 0,  GetClipMinX, GetClipMinY);
		ObjEffect_SetVertexUV(obj, 1,  X[1]-(Y[1]-GetClipMinY)/tan(CAngle-180+CDAngle-90),  GetClipMinY);
		ObjEffect_SetVertexUV(obj, 2, X[2],  Y[2]);
		ObjEffect_SetVertexUV(obj, 3, GetClipMinX, Y[3]+(X[3]-GetClipMinX)/tan(CAngle-180+CDAngle-90));
		}

		if(X[0]<GetClipMinX && Y[2]<GetClipMinY)
		{
		ObjEffect_CreateVertex(obj, 4);

		ObjEffect_SetVertexXY(obj, 0, -PX, -PY-(X[0]-GetClipMinX)/cos(CAngle-180+CDAngle-90));
		ObjEffect_SetVertexXY(obj, 1, OriDis1*sin(OriAngle1+CAngle-180-90+CDAngle-90),OriDis1*cos(OriAngle1+CAngle-180-90+CDAngle-90));
		ObjEffect_SetVertexXY(obj, 2, PX+(Y[2]-GetClipMinY)/cos(CAngle-180+CDAngle-90), PY);
		ObjEffect_SetVertexXY(obj, 3, -PX, PY);
		
		ObjEffect_SetVertexUV(obj, 0,  GetClipMinX, Y[0]-(X[0]-GetClipMinX)*tan(CAngle-180+CDAngle-90));
		ObjEffect_SetVertexUV(obj, 1,  GetClipMinX, GetClipMinY);
		ObjEffect_SetVertexUV(obj, 2, X[2]+(Y[2]-GetClipMinY)*tan(CAngle-180+CDAngle-90),  GetClipMinY);
		ObjEffect_SetVertexUV(obj, 3, X[3], Y[3]);
		}

		if(X[1]<GetClipMinX && Y[3]<GetClipMinY)
		{
		ObjEffect_CreateVertex(obj, 4);

		ObjEffect_SetVertexXY(obj, 0, -PX, -PY);
		ObjEffect_SetVertexXY(obj, 1, PX+(X[1]-GetClipMinX)/sin(CAngle+CDAngle-90),  -PY);
		ObjEffect_SetVertexXY(obj, 2, OriDis1*sin(OriAngle1+CAngle-180-90+CDAngle-90),OriDis1*cos(OriAngle1+CAngle-180-90+CDAngle-90));
		ObjEffect_SetVertexXY(obj, 3,  -PX,  PY+(Y[3]-GetClipMinY)/sin(CAngle+CDAngle-90));
		
		ObjEffect_SetVertexUV(obj, 0,  X[0],  Y[0]);
		ObjEffect_SetVertexUV(obj, 1,  GetClipMinX, Y[1]+(X[1]-GetClipMinX)/tan(CAngle+CDAngle-90));
		ObjEffect_SetVertexUV(obj, 2, GetClipMinX, GetClipMinY);
		ObjEffect_SetVertexUV(obj, 3, X[3]-(Y[3]-GetClipMinY)/tan(CAngle+CDAngle-90), GetClipMinY);
		}

		if(Y[0]<GetClipMinY && X[2]<GetClipMinX)
		{
		ObjEffect_CreateVertex(obj, 4);

		ObjEffect_SetVertexXY(obj, 0, -PX-(Y[0]-GetClipMinY)/cos(CAngle+CDAngle-90), -PY);
		ObjEffect_SetVertexXY(obj, 1, PX,  -PY);
		ObjEffect_SetVertexXY(obj, 2, PX, PY+(X[2]-GetClipMinX)/cos(CAngle+CDAngle-90));
		ObjEffect_SetVertexXY(obj, 3,  OriDis1*sin(OriAngle1+CAngle-180-90+CDAngle-90),OriDis1*cos(OriAngle1+CAngle-180-90+CDAngle-90));
		
		ObjEffect_SetVertexUV(obj, 0,  X[0]+(Y[0]-GetClipMinY)*tan(CAngle+CDAngle-90),  GetClipMinY);
		ObjEffect_SetVertexUV(obj, 1,  X[1], Y[1]);
		ObjEffect_SetVertexUV(obj, 2, GetClipMinX,  Y[2]-(X[2]-GetClipMinX)*tan(CAngle+CDAngle-90));
		ObjEffect_SetVertexUV(obj, 3, GetClipMinX, GetClipMinY);
		}

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
		if(X[1]>GetClipMaxX && Y[3]<GetClipMinY)
		{
		ObjEffect_CreateVertex(obj, 4);

		ObjEffect_SetVertexXY(obj, 0, OriDis2*sin(OriAngle2+CAngle-180-90+CDAngle-90),OriDis2*cos(OriAngle2+CAngle-180-90+CDAngle-90));
		ObjEffect_SetVertexXY(obj, 1, PX,  -PY+(X[1]-GetClipMaxX)/sin(CAngle-270+CDAngle-90));
		ObjEffect_SetVertexXY(obj, 2, PX, PY);
		ObjEffect_SetVertexXY(obj, 3,  -PX-(Y[3]-GetClipMinY)/sin(CAngle-270+CDAngle-90),  PY);
		
		ObjEffect_SetVertexUV(obj, 0,  GetClipMaxX, GetClipMinY);
		ObjEffect_SetVertexUV(obj, 1,  GetClipMaxX, Y[1]+(X[1]-GetClipMaxX)/tan(CAngle-270+CDAngle-90));
		ObjEffect_SetVertexUV(obj, 2, X[2],  Y[2]);
		ObjEffect_SetVertexUV(obj, 3, X[3]-(Y[3]-GetClipMinY)/tan(CAngle-270+CDAngle-90), GetClipMinY);
		}

		if(Y[0]<GetClipMinY && X[2]>GetClipMaxX)
		{
		ObjEffect_CreateVertex(obj, 4);

		ObjEffect_SetVertexXY(obj, 0, -PX, -PY-(Y[0]-GetClipMinY)/cos(CAngle-270+CDAngle-90));
		ObjEffect_SetVertexXY(obj, 1,  OriDis2*sin(OriAngle2+CAngle-180-90+CDAngle-90),OriDis2*cos(OriAngle2+CAngle-180-90+CDAngle-90));
		ObjEffect_SetVertexXY(obj, 2, PX-(X[2]-GetClipMaxX)/cos(CAngle-270+CDAngle-90), PY);
		ObjEffect_SetVertexXY(obj, 3,  -PX,  PY);
		
		ObjEffect_SetVertexUV(obj, 0,  X[0]+(Y[0]-GetClipMinY)*tan(CAngle-270+CDAngle-90),  GetClipMinY);
		ObjEffect_SetVertexUV(obj, 1,  GetClipMaxX, GetClipMinY);
		ObjEffect_SetVertexUV(obj, 2, GetClipMaxX,  Y[2]+(X[2]-GetClipMaxX)*tan(CAngle-270+CDAngle-90));
		ObjEffect_SetVertexUV(obj, 3, X[3], Y[3]);
		}

		if(Y[1]<GetClipMinY && X[3]>GetClipMaxX)
		{
		ObjEffect_CreateVertex(obj, 4);

		ObjEffect_SetVertexXY(obj, 0, -PX, -PY);
		ObjEffect_SetVertexXY(obj, 1, PX+(Y[1]-GetClipMinY)*sin(CAngle-90+CDAngle-90),  -PY);
		ObjEffect_SetVertexXY(obj, 2, OriDis2*sin(OriAngle2+CAngle-180-90+CDAngle-90),OriDis2*cos(OriAngle2+CAngle-180-90+CDAngle-90));
		ObjEffect_SetVertexXY(obj, 3,  -PX,  PY-(X[3]-GetClipMaxX)*sin(CAngle-90+CDAngle-90));
		
		ObjEffect_SetVertexUV(obj, 0,  X[0],  Y[0]);
		ObjEffect_SetVertexUV(obj, 1,  X[1]+(Y[1]-GetClipMinY)/tan(CAngle-90+CDAngle-90), GetClipMinY);
		ObjEffect_SetVertexUV(obj, 2, GetClipMaxX, GetClipMinY);
		ObjEffect_SetVertexUV(obj, 3, GetClipMaxX, Y[3]+(X[3]-GetClipMaxX)/tan(CAngle-90+CDAngle-90));
		}

		if(X[0]>GetClipMaxX && Y[2]<GetClipMinY)
		{
		ObjEffect_CreateVertex(obj, 4);

		ObjEffect_SetVertexXY(obj, 0, -PX+(X[0]-GetClipMaxX)/cos(90-CAngle-CDAngle+90), -PY);
		ObjEffect_SetVertexXY(obj, 1, PX,  -PY);
		ObjEffect_SetVertexXY(obj, 2, PX, PY+(Y[2]-GetClipMinY)/cos(90-CAngle-CDAngle+90));
		ObjEffect_SetVertexXY(obj, 3,  OriDis2*sin(OriAngle2+CAngle-180-90+CDAngle-90),OriDis2*cos(OriAngle2+CAngle-180-90+CDAngle-90));
		
		ObjEffect_SetVertexUV(obj, 0,  GetClipMaxX,  Y[0]+(X[0]-GetClipMaxX)*tan(90-CAngle-CDAngle+90));
		ObjEffect_SetVertexUV(obj, 1,  X[1], Y[1]);
		ObjEffect_SetVertexUV(obj, 2, X[2]+(Y[2]-GetClipMinY)*tan(90-CAngle-CDAngle+90),  GetClipMinY);
		ObjEffect_SetVertexUV(obj, 3, GetClipMaxX, GetClipMinY);
		}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
		if(Y[1]>GetClipMaxY && X[3]>GetClipMaxX)
		{
		ObjEffect_CreateVertex(obj, 4);

		ObjEffect_SetVertexXY(obj, 0, OriDis3*sin(OriAngle3+CAngle-180-90+CDAngle-90),OriDis3*cos(OriAngle3+CAngle-180-90+CDAngle-90));
		ObjEffect_SetVertexXY(obj, 1, PX,  -PY-(Y[1]-GetClipMaxY)/sin(CAngle-180+CDAngle-90));
		ObjEffect_SetVertexXY(obj, 2, PX, PY);
		ObjEffect_SetVertexXY(obj, 3,  -PX-(X[3]-GetClipMaxX)/sin(CAngle-180+CDAngle-90),  PY);
		
		ObjEffect_SetVertexUV(obj, 0, GetClipMaxX, GetClipMaxY);
		ObjEffect_SetVertexUV(obj, 1,  X[1]+(Y[1]-GetClipMaxY)/tan(CAngle-180+CDAngle-90), GetClipMaxY);
		ObjEffect_SetVertexUV(obj, 2, X[2],  Y[2]);
		ObjEffect_SetVertexUV(obj, 3, GetClipMaxX, Y[3]+(X[3]-GetClipMaxX)/tan(CAngle-180+CDAngle-90));
		}

		if(X[0]>GetClipMaxX && Y[2]>GetClipMaxY)
		{
		ObjEffect_CreateVertex(obj, 4);

		ObjEffect_SetVertexXY(obj, 0, -PX, -PY-(X[0]-GetClipMaxX)/cos(CAngle-180+CDAngle-90));
		ObjEffect_SetVertexXY(obj, 1, OriDis3*sin(OriAngle3+CAngle-180-90+CDAngle-90),OriDis3*cos(OriAngle3+CAngle-180-90+CDAngle-90));
		ObjEffect_SetVertexXY(obj, 2, PX+(Y[2]-GetClipMaxY)/cos(CAngle-180+CDAngle-90), PY);
		ObjEffect_SetVertexXY(obj, 3, -PX, PY);
		
		ObjEffect_SetVertexUV(obj, 0,  GetClipMaxX, Y[0]-(X[0]-GetClipMaxX)*tan(CAngle-180+CDAngle-90));
		ObjEffect_SetVertexUV(obj, 1,  GetClipMaxX, GetClipMaxY);
		ObjEffect_SetVertexUV(obj, 2, X[2]+(Y[2]-GetClipMaxY)*tan(CAngle-180+CDAngle-90),  GetClipMaxY);
		ObjEffect_SetVertexUV(obj, 3, X[3], Y[3]);
		}

		if(X[1]>GetClipMaxX && Y[3]>GetClipMaxY)
		{
		ObjEffect_CreateVertex(obj, 4);

		ObjEffect_SetVertexXY(obj, 0, -PX, -PY);
		ObjEffect_SetVertexXY(obj, 1, PX-(X[1]-GetClipMaxX)/sin(CAngle-180+CDAngle-90),  -PY);
		ObjEffect_SetVertexXY(obj, 2, OriDis3*sin(OriAngle3+CAngle-180-90+CDAngle-90),OriDis3*cos(OriAngle3+CAngle-180-90+CDAngle-90));
		ObjEffect_SetVertexXY(obj, 3,  -PX,  PY-(Y[3]-GetClipMaxY)/sin(CAngle-180+CDAngle-90));
		
		ObjEffect_SetVertexUV(obj, 0,  X[0],  Y[0]);
		ObjEffect_SetVertexUV(obj, 1,  GetClipMaxX, Y[1]+(X[1]-GetClipMaxX)/tan(CAngle-180+CDAngle-90));
		ObjEffect_SetVertexUV(obj, 2, GetClipMaxX, GetClipMaxY);
		ObjEffect_SetVertexUV(obj, 3, X[3]-(Y[3]-GetClipMaxY)/tan(CAngle-180+CDAngle-90), GetClipMaxY);
		}

		if(Y[0]>GetClipMaxY && X[2]>GetClipMaxX)
		{
		ObjEffect_CreateVertex(obj, 4);

		ObjEffect_SetVertexXY(obj, 0, -PX-(Y[0]-GetClipMaxY)/cos(CAngle+CDAngle-90), -PY);
		ObjEffect_SetVertexXY(obj, 1, PX,  -PY);
		ObjEffect_SetVertexXY(obj, 2, PX, PY+(X[2]-GetClipMaxX)/cos(CAngle+CDAngle-90));
		ObjEffect_SetVertexXY(obj, 3,  OriDis3*sin(OriAngle3+CAngle-180-90+CDAngle-90),OriDis3*cos(OriAngle3+CAngle-180-90+CDAngle-90));
		
		ObjEffect_SetVertexUV(obj, 0,  X[0]+(Y[0]-GetClipMaxY)*tan(CAngle+CDAngle-90),  GetClipMaxY);
		ObjEffect_SetVertexUV(obj, 1,  X[1], Y[1]);
		ObjEffect_SetVertexUV(obj, 2, GetClipMaxX,  Y[2]-(X[2]-GetClipMaxX)*tan(CAngle+CDAngle-90));
		ObjEffect_SetVertexUV(obj, 3, GetClipMaxX, GetClipMaxY);
		}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
		if(X[1]<GetClipMinX && Y[3]>GetClipMaxY)
		{
		ObjEffect_CreateVertex(obj, 4);

		ObjEffect_SetVertexXY(obj, 0, OriDis4*sin(OriAngle4+CAngle-180-90+CDAngle-90),OriDis4*cos(OriAngle4+CAngle-180-90+CDAngle-90));
		ObjEffect_SetVertexXY(obj, 1, PX,  -PY+(X[1]-GetClipMinX)/sin(CAngle-270+CDAngle-90));
		ObjEffect_SetVertexXY(obj, 2, PX, PY);
		ObjEffect_SetVertexXY(obj, 3,  -PX-(Y[3]-GetClipMaxY)/sin(CAngle-270+CDAngle-90),  PY);
		
		ObjEffect_SetVertexUV(obj, 0,  GetClipMinX, GetClipMaxY);
		ObjEffect_SetVertexUV(obj, 1,  GetClipMinX, Y[1]+(X[1]-GetClipMinX)/tan(CAngle-270+CDAngle-90));
		ObjEffect_SetVertexUV(obj, 2, X[2],  Y[2]);
		ObjEffect_SetVertexUV(obj, 3, X[3]-(Y[3]-GetClipMaxY)/tan(CAngle-270+CDAngle-90), GetClipMaxY);
		}

		if(Y[0]>GetClipMaxY && X[2]<GetClipMinX)
		{
		ObjEffect_CreateVertex(obj, 4);

		ObjEffect_SetVertexXY(obj, 0, -PX, -PY-(Y[0]-GetClipMaxY)/cos(CAngle-270+CDAngle-90));
		ObjEffect_SetVertexXY(obj, 1,  OriDis4*sin(OriAngle4+CAngle-180-90+CDAngle-90),OriDis4*cos(OriAngle4+CAngle-180-90+CDAngle-90));
		ObjEffect_SetVertexXY(obj, 2, PX-(X[2]-GetClipMinX)/cos(CAngle-270+CDAngle-90), PY);
		ObjEffect_SetVertexXY(obj, 3,  -PX,  PY);
		
		ObjEffect_SetVertexUV(obj, 0,  X[0]+(Y[0]-GetClipMaxY)*tan(CAngle-270+CDAngle-90),  GetClipMaxY);
		ObjEffect_SetVertexUV(obj, 1,  GetClipMinX, GetClipMaxY);
		ObjEffect_SetVertexUV(obj, 2, GetClipMinX,  Y[2]-(X[2]-GetClipMinX)*tan(CAngle-270+CDAngle-90));
		ObjEffect_SetVertexUV(obj, 3, X[3], Y[3]);
		}

		if(Y[1]>GetClipMaxY && X[3]<GetClipMinX)
		{
		ObjEffect_CreateVertex(obj, 4);

		ObjEffect_SetVertexXY(obj, 0, -PX, -PY);
		ObjEffect_SetVertexXY(obj, 1, PX+(Y[1]-GetClipMaxY)*sin(CAngle-90+CDAngle-90),  -PY);
		ObjEffect_SetVertexXY(obj, 2, OriDis4*sin(OriAngle4+CAngle-180-90+CDAngle-90),OriDis4*cos(OriAngle4+CAngle-180-90+CDAngle-90));
		ObjEffect_SetVertexXY(obj, 3,  -PX,  PY-(X[3]-GetClipMinX)*sin(CAngle-90+CDAngle-90));
		
		ObjEffect_SetVertexUV(obj, 0,  X[0],  Y[0]);
		ObjEffect_SetVertexUV(obj, 1,  X[1]+(Y[1]-GetClipMaxY)/tan(CAngle-90+CDAngle-90), GetClipMaxY);
		ObjEffect_SetVertexUV(obj, 2, GetClipMinX, GetClipMaxY);
		ObjEffect_SetVertexUV(obj, 3, GetClipMinX, Y[3]+(X[3]-GetClipMinX)/tan(CAngle-90+CDAngle-90));
		}

		if(X[0]<GetClipMinX && Y[2]>GetClipMaxY)
		{
		ObjEffect_CreateVertex(obj, 4);

		ObjEffect_SetVertexXY(obj, 0, -PX+(X[0]-GetClipMinX)/cos(90-CAngle-CDAngle+90), -PY);
		ObjEffect_SetVertexXY(obj, 1, PX,  -PY);
		ObjEffect_SetVertexXY(obj, 2, PX, PY+(Y[2]-GetClipMaxY)/cos(90-CAngle-CDAngle+90));
		ObjEffect_SetVertexXY(obj, 3,  OriDis4*sin(OriAngle4+CAngle-180-90+CDAngle-90),OriDis4*cos(OriAngle4+CAngle-180-90+CDAngle-90));
		
		ObjEffect_SetVertexUV(obj, 0,  GetClipMinX,  Y[0]+(X[0]-GetClipMinX)*tan(90-CAngle-CDAngle+90));
		ObjEffect_SetVertexUV(obj, 1,  X[1], Y[1]);
		ObjEffect_SetVertexUV(obj, 2, X[2]-(Y[2]-GetClipMaxY)*tan(90-CAngle-CDAngle+90),  GetClipMaxY);
		ObjEffect_SetVertexUV(obj, 3, GetClipMinX, GetClipMaxY);
		}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////全ての頂点がシーン外にある場合/////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
		if(X[0]<GetClipMinX && Y[1]<GetClipMinY && Y[2]<GetClipMinY && X[3]<GetClipMinX)
		{
		ObjEffect_CreateVertex(obj, 3);

		ObjEffect_SetVertexXY(obj, 0,  OriDis1*sin(OriAngle1+CAngle-180-90+CDAngle-90),OriDis1*cos(OriAngle1+CAngle-180-90+CDAngle-90));
		ObjEffect_SetVertexXY(obj, 1, PX+(Y[2]-GetClipMinY)/cos(CAngle-180+CDAngle-90), PY);
		ObjEffect_SetVertexXY(obj, 2,  -PX-(X[3]-GetClipMinX)/sin(CAngle-180+CDAngle-90),  PY);
		
		ObjEffect_SetVertexUV(obj, 0, GetClipMinX, GetClipMinY);
		ObjEffect_SetVertexUV(obj, 1, X[2]+(Y[2]-GetClipMinY)*tan(CAngle-180+CDAngle-90),  GetClipMinY);
		ObjEffect_SetVertexUV(obj, 2, GetClipMinX, Y[3]+(X[3]-GetClipMinX)/tan(CAngle-180+CDAngle-90));
		}

		if(X[2]<GetClipMinX && Y[3]<GetClipMinY && Y[0]<GetClipMinY && X[1]<GetClipMinX)
		{
		ObjEffect_CreateVertex(obj, 3);

		ObjEffect_SetVertexXY(obj, 0,  OriDis1*sin(OriAngle1+CAngle-180-90+CDAngle-90),OriDis1*cos(OriAngle1+CAngle-180-90+CDAngle-90));
		ObjEffect_SetVertexXY(obj, 1, -PX-(Y[0]-GetClipMinY)/cos(CAngle+CDAngle-90), -PY);
		ObjEffect_SetVertexXY(obj, 2,  PX+(X[1]-GetClipMinX)/sin(CAngle+CDAngle-90),  -PY);
		
		ObjEffect_SetVertexUV(obj, 0, GetClipMinX, GetClipMinY);
		ObjEffect_SetVertexUV(obj, 1, X[0]+(Y[0]-GetClipMinY)*tan(CAngle+CDAngle-90),  GetClipMinY);
		ObjEffect_SetVertexUV(obj, 2, GetClipMinX, Y[1]+(X[1]-GetClipMinX)/tan(CAngle+CDAngle-90));
		}

		if(Y[0]<GetClipMinY && X[1]>GetClipMaxX && X[2]>GetClipMaxX && Y[3]<GetClipMinY)
		{
		ObjEffect_CreateVertex(obj, 3);

		ObjEffect_SetVertexXY(obj, 0,  OriDis2*sin(OriAngle2+CAngle-180-90+CDAngle-90),OriDis2*cos(OriAngle2+CAngle-180-90+CDAngle-90));
		ObjEffect_SetVertexXY(obj, 1, PX+(X[2]-GetClipMaxX)/cos(CAngle-90+CDAngle-90), PY);
		ObjEffect_SetVertexXY(obj, 2,  -PX+(Y[3]-GetClipMinY)/sin(CAngle-90+CDAngle-90), PY);
		
		ObjEffect_SetVertexUV(obj, 0, GetClipMaxX, GetClipMinY);
		ObjEffect_SetVertexUV(obj, 1, GetClipMaxX,  Y[2]+(X[2]-GetClipMaxX)*tan(CAngle-90+CDAngle-90));
		ObjEffect_SetVertexUV(obj, 2, X[3]+(Y[3]-GetClipMinY)/tan(CAngle-90+CDAngle-90), GetClipMinY);
		}

		if(Y[2]<GetClipMinY && X[3]>GetClipMaxX && X[0]>GetClipMaxX && Y[1]<GetClipMinY)
		{
		ObjEffect_CreateVertex(obj, 3);

		ObjEffect_SetVertexXY(obj, 0,  OriDis2*sin(OriAngle2+CAngle-180-90+CDAngle-90),OriDis2*cos(OriAngle2+CAngle-180-90+CDAngle-90));
		ObjEffect_SetVertexXY(obj, 1, -PX+(X[2]-GetClipMaxX)/cos(CAngle-270+CDAngle-90), -PY);
		ObjEffect_SetVertexXY(obj, 2,  PX+(Y[3]-GetClipMinY)/sin(CAngle-270+CDAngle-90), -PY);
		
		ObjEffect_SetVertexUV(obj, 0, GetClipMaxX, GetClipMinY);
		ObjEffect_SetVertexUV(obj, 1, GetClipMaxX,  Y[0]+(X[0]-GetClipMaxX)*tan(CAngle-270+CDAngle-90));
		ObjEffect_SetVertexUV(obj, 2, X[1]+(Y[1]-GetClipMinY)/tan(CAngle-270+CDAngle-90), GetClipMinY);
		}

		if(X[0]>GetClipMaxX && Y[1]>GetClipMaxY && Y[2]>GetClipMaxY && X[3]>GetClipMaxX)
		{
		ObjEffect_CreateVertex(obj, 3);

		ObjEffect_SetVertexXY(obj, 0,  OriDis3*sin(OriAngle3+CAngle-180-90+CDAngle-90),OriDis3*cos(OriAngle3+CAngle-180-90+CDAngle-90));
		ObjEffect_SetVertexXY(obj, 1, PX+(Y[2]-GetClipMaxY)/cos(CAngle-180+CDAngle-90), PY);
		ObjEffect_SetVertexXY(obj, 2,  -PX-(X[3]-GetClipMaxX)/sin(CAngle-180+CDAngle-90),  PY);
		
		ObjEffect_SetVertexUV(obj, 0, GetClipMaxX, GetClipMaxY);
		ObjEffect_SetVertexUV(obj, 1, X[2]+(Y[2]-GetClipMaxY)*tan(CAngle-180+CDAngle-90),  GetClipMaxY);
		ObjEffect_SetVertexUV(obj, 2, GetClipMaxX, Y[3]+(X[3]-GetClipMaxX)/tan(CAngle-180+CDAngle-90));
		}

		if(X[2]>GetClipMaxX && Y[3]>GetClipMaxY && Y[0]>GetClipMaxY && X[1]>GetClipMaxX)
		{
		ObjEffect_CreateVertex(obj, 3);

		ObjEffect_SetVertexXY(obj, 0,  OriDis3*sin(OriAngle3+CAngle-180-90+CDAngle-90),OriDis3*cos(OriAngle3+CAngle-180-90+CDAngle-90));
		ObjEffect_SetVertexXY(obj, 1, -PX+(Y[0]-GetClipMaxY)/cos(CAngle-180+CDAngle-90), -PY);
		ObjEffect_SetVertexXY(obj, 2,  PX-(X[1]-GetClipMaxX)/sin(CAngle-180+CDAngle-90),  -PY);
		
		ObjEffect_SetVertexUV(obj, 0, GetClipMaxX, GetClipMaxY);
		ObjEffect_SetVertexUV(obj, 1, X[0]+(Y[0]-GetClipMaxY)*tan(CAngle-180+CDAngle-90),  GetClipMaxY);
		ObjEffect_SetVertexUV(obj, 2, GetClipMaxX, Y[1]+(X[1]-GetClipMaxX)/tan(CAngle-180+CDAngle-90));
		}

		if(Y[0]>GetClipMaxY && X[1]<GetClipMinX && X[2]<GetClipMinX && Y[3]>GetClipMaxY)
		{
		ObjEffect_CreateVertex(obj, 3);

		ObjEffect_SetVertexXY(obj, 0,  OriDis4*sin(OriAngle4+CAngle-180-90+CDAngle-90),OriDis4*cos(OriAngle4+CAngle-180-90+CDAngle-90));
		ObjEffect_SetVertexXY(obj, 1, PX+(X[2]-GetClipMinX)/cos(CAngle-90+CDAngle-90), PY);
		ObjEffect_SetVertexXY(obj, 2,  -PX+(Y[3]-GetClipMaxY)/sin(CAngle-90+CDAngle-90), PY);
		
		ObjEffect_SetVertexUV(obj, 0, GetClipMinX, GetClipMaxY);
		ObjEffect_SetVertexUV(obj, 1, GetClipMinX,  Y[2]+(X[2]-GetClipMinX)*tan(CAngle-90+CDAngle-90));
		ObjEffect_SetVertexUV(obj, 2, X[3]+(Y[3]-GetClipMaxY)/tan(CAngle-90+CDAngle-90), GetClipMaxY);
		}

		if(Y[2]>GetClipMaxY && X[3]<GetClipMinX && X[0]<GetClipMinX && Y[1]>GetClipMaxY)
		{
		ObjEffect_CreateVertex(obj, 3);

		ObjEffect_SetVertexXY(obj, 0,  OriDis4*sin(OriAngle4+CAngle-180-90+CDAngle-90),OriDis4*cos(OriAngle4+CAngle-180-90+CDAngle-90));
		ObjEffect_SetVertexXY(obj, 1, -PX+(X[0]-GetClipMinX)/cos(CAngle-90+CDAngle-90), -PY);
		ObjEffect_SetVertexXY(obj, 2,  PX+(Y[1]-GetClipMaxY)/sin(CAngle-90+CDAngle-90), -PY);
		
		ObjEffect_SetVertexUV(obj, 0, GetClipMinX, GetClipMaxY);
		ObjEffect_SetVertexUV(obj, 1, GetClipMinX,  Y[0]+(X[0]-GetClipMinX)*tan(CAngle-90+CDAngle-90));
		ObjEffect_SetVertexUV(obj, 2, X[1]+(Y[1]-GetClipMaxY)/tan(CAngle-90+CDAngle-90), GetClipMaxY);
		}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////全ての頂点がシーン内にある場合/////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

		if(X[0]>GetClipMinX && X[0]<GetClipMaxX && Y[0]>GetClipMinY && Y[0]<GetClipMaxY   &&   X[1]>GetClipMinX && X[1]<GetClipMaxX && Y[1]>GetClipMinY && Y[1]<GetClipMaxY   &&   X[2]>GetClipMinX && X[2]<GetClipMaxX && Y[2]>GetClipMinY && Y[2]<GetClipMaxY   &&   X[3]>GetClipMinX && X[3]<GetClipMaxX && Y[3]>GetClipMinY && Y[3]<GetClipMaxY)
		{
		ObjEffect_CreateVertex(obj, 4);

		ObjEffect_SetVertexXY(obj, 0, -PX, -PY);
		ObjEffect_SetVertexXY(obj, 1, PX,  -PY);
		ObjEffect_SetVertexXY(obj, 2, PX, PY);
		ObjEffect_SetVertexXY(obj, 3,  -PX,  PY);
		
		ObjEffect_SetVertexUV(obj, 0,  X[0],  Y[0]);
		ObjEffect_SetVertexUV(obj, 1,  X[1], Y[1]);
		ObjEffect_SetVertexUV(obj, 2, X[2],  Y[2]);
		ObjEffect_SetVertexUV(obj, 3, X[3], Y[3]);
		}
}

function dxdy(i,j,dis2,finderangle,CAngle,CameraDir,size)//カメラの中心からカメラの端までのX座標
{
	let aaa=dis2*cos(finderangle+CAngle-270)+size*i*cos(CAngle+CameraDir)+size*j*sin(-CAngle-CameraDir);
	return(aaa);
}
function dxdy2(i,j,dis2,finderangle,CAngle,CameraDir,size)//カメラの中心からカメラの端までのY座標
{
	let aaa=dis2*sin(finderangle+CAngle-270)+size*i*sin(CAngle+CameraDir)+size*j*cos(-CAngle-CameraDir);
	return(aaa);
}