首页 / 浏览问题 / 移动 / 问题详情
Android 三维场景绘制的标注功能
wayward  (29分)  初出茅庐
1月18

在对绘制的线面尝试实现标注的功能,通过下列代码给TextPart3D赋值后,要怎么样才能把GeoText3D添加到跟踪图层上,并确定位置啊,因为是新手,不知道要怎么写,有示例可以参考吗

private void measureDistance(Tracking3DEvent tracking3DEvent) {
        // 加点
        // 更新总距离长度
        double totalLength = tracking3DEvent.getTotalLength();
        double totalcurrentlength = tracking3DEvent.getCurrentLength();
        double x = tracking3DEvent.getX();
        Log.v("lzw", "totalLength=" + totalLength + ";" + "totalcurrentlength=" + totalcurrentlength);
        Message msg = new Message();
        Bundle bundle = new Bundle();
        bundle.putDouble("length", totalLength);
        msg.setData(bundle);
        totalLengthHandler.sendMessage(msg);

        TextPart3D textPart3D1 = new TextPart3D();
        textPart3D1.setText(String.valueOf(msg.getData().getDouble("length")));
        Log.i("测试1", "textPart3D=" + textPart3D1.getText());

        GeoText3D geoText3D = new GeoText3D(textPart3D1);
        GeoPlacemark geoPlacemark = new GeoPlacemark("3D",geoText3D);
        sceneControl.getScene().getTrackingLayer().add(geoPlacemark,"geoText");

    }

1个回答

您好,在构造Textpart3D的时候就需要设置文本的显示位置,也就是锚点坐标setX,setY。设置完后添加到GeoText3D对象中,再添加到跟踪图层
董懿鑫  (8,992分)  登峰造极
1月19
...