SkylineGlobe는 3차원 모델의 BBOX를 2차 개발하고 Tint 속성을 설정하는 방법
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title> TerrainModel </title>
<script type="text/javascript">
function StartF() {
try {
var sg = CreateSGObj();
sg.AttachEvent("OnLButtonDown", OnLButtonDown);
}
catch (e) {
alert(e);
}
}
function EndF() {
var sg = CreateSGObj();
sg.DetachEvent("OnLButtonDown", OnLButtonDown);
}
function OnLButtonDown(Flags, X, Y) {
try
{
var sg = CreateSGObj();
var iwp = sg.Window.PixelToWorld(X, Y, 1 + 8192);
if (iwp != null) {
alert(iwp.ObjectID);
var oModel = sg.Creator.GetObject(iwp.ObjectID);
var oBBox = null;
if (oModel.ObjectType == 17) // TerrainModel
{
oModel.Terrain.Tint.abgrColor = 0x66FF0000;
oBBox = oModel.Terrain.BBox;
}
else if (oModel.ObjectType == 33) // Feature
{
oModel.Tint.abgrColor = 0x66FF0000;
//alert(oModel.Geometry.Wks.ExportToWKT());
var statisticsgPolyObj = sg.Creator.CreatePolygon(oModel.Geometry, sg.Creator.CreateColor(255, 0, 0, 255), sg.Creator.CreateColor(0, 255, 0, 26), 0, "", "temp");
//oBBox = oModel.BBox; // ?
}
else {
}
if (oBBox != null) {
var myGeometry = sg.Creator.GeometryCreator.CreateLinearRingGeometry([oBBox.MaxX, oBBox.MaxY, 0, oBBox.MaxX, oBBox.MinY, 0, oBBox.MinX, oBBox.MinY, 0, oBBox.MinX, oBBox.MaxY, 0])
var statisticsgPolyObj = sg.Creator.CreatePolygon(myGeometry, sg.Creator.CreateColor(255, 0, 0, 255), sg.Creator.CreateColor(0, 255, 0, 26), 0, "", "temp");
}
}
}
catch (e)
{
alert(e);
}
return false;
}
//------------------------------------------------------------
// sgworld 2015.06.09. TEPro6.6
//------------------------------------------------------------
function CreateSGObj() {
var obj = $("sgworld");
if (obj == null) {
obj = document.createElement('object');
document.body.appendChild(obj);
obj.name = "sgworld";
obj.id = "sgworld";
obj.classid = "CLSID:3A4F9199-65a8-11d5-85c1-0001023952c1";
}
return obj;
}
function $(id) {
return window.document.getElementById(id);
}
</script>
</head>
<body>
<input id="Button1" type="button" value=" " onclick="StartF()" />
<input id="Button2" type="button" value=" " onclick="EndF()" />
<div id="res"></div>
<object id="TerraExplorer3DWindow" classid="CLSID:3a4f9192-65a8-11d5-85c1-0001023952c1" style="width:500px;height:400px;"></object>
<object id="TerraExplorerInformationWindow" classid="CLSID:3a4f9193-65a8-11d5-85c1-0001023952c1" style="width:300px;height:400px;"></object>
</body>
</html>
이 내용에 흥미가 있습니까?
현재 기사가 여러분의 문제를 해결하지 못하는 경우 AI 엔진은 머신러닝 분석(스마트 모델이 방금 만들어져 부정확한 경우가 있을 수 있음)을 통해 가장 유사한 기사를 추천합니다:
다양한 언어의 JSONJSON은 Javascript 표기법을 사용하여 데이터 구조를 레이아웃하는 데이터 형식입니다. 그러나 Javascript가 코드에서 이러한 구조를 나타낼 수 있는 유일한 언어는 아닙니다. 저는 일반적으로 '객체'{}...
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
CC BY-SA 2.5, CC BY-SA 3.0 및 CC BY-SA 4.0에 따라 라이센스가 부여됩니다.