Open lzx1 opened 1 year ago
I want to draw a line like this:
I used WideVectorInfo: val sourceImage = BitmapFactory.decodeResource(activity.resources, R.drawable.linesource) val texSet = TextureSettings().apply { wrapU = true wrapV = true } baseController.addTexture(sourceImage, texSet, ThreadMode.ThreadCurrent) val wideVecInfo = WideVectorInfo().also { it.color = color it.lineWidth = width it.drawPriority = drawPriority if (tex != null) { it.setTexture(tex) } it.edgeFalloff = edge } try { val stream = activity.assets.open("wide_vecs/$name") VectorObject.createFromGeoJSON(stream.source().buffer().readUtf8()) ?.subdivideToGlobeGreatCircle(0.0001)?.let { return listOfNotNull( baseController.addWideVector(it, wideVecInfo, ThreadMode.ThreadCurrent)) } } catch (e: Exception) { Log.e(javaClass.simpleName, "Failed", e) }
the linesource drawable resources:
But what I got was this:
What should I do?
I'd suggest creating a short example to get the texture application right and then expand outward to the bigger example.
I want to draw a line like this:
I used WideVectorInfo: val sourceImage = BitmapFactory.decodeResource(activity.resources, R.drawable.linesource) val texSet = TextureSettings().apply { wrapU = true wrapV = true } baseController.addTexture(sourceImage, texSet, ThreadMode.ThreadCurrent) val wideVecInfo = WideVectorInfo().also { it.color = color it.lineWidth = width it.drawPriority = drawPriority if (tex != null) { it.setTexture(tex) } it.edgeFalloff = edge } try { val stream = activity.assets.open("wide_vecs/$name") VectorObject.createFromGeoJSON(stream.source().buffer().readUtf8()) ?.subdivideToGlobeGreatCircle(0.0001)?.let { return listOfNotNull( baseController.addWideVector(it, wideVecInfo, ThreadMode.ThreadCurrent)) } } catch (e: Exception) { Log.e(javaClass.simpleName, "Failed", e) }
the linesource drawable resources:
But what I got was this:
What should I do?