Tchernobill Posted October 20, 2022 Share Posted October 20, 2022 use renderIsoCircle. (constant parameters) change zoom level. Current the circle changes its position relative to the terrain database. the circle changes its position relative to the screen. Expected the circle does not change its position relative to the terrain database. Link to comment Share on other sites More sharing options...
Tchernobill Posted October 20, 2022 Author Share Posted October 20, 2022 It works better with isoToScreenX and y functions function MyLuaUIElementClass:renderIsoCircle(playerNum, posX, posY, posZ, ray, r, g, b, a) local angularStep = 0.3490658503988659D; for var11 = 0, 6.283185307179586D, angularStep do--from 0 to 2 PI local xStart = posX + ray * Math.cos(var11); local yStart = posY + ray * Math.sin(var11); local xEnd = posX + ray * Math.cos(var11 + angularStep); local yEnd = posY + ray * Math.sin(var11 + angularStep); local xScreen1 = isoToScreenX(playerNum, xStart, yStart, posZ); local yScreen1 = isoToScreenY(playerNum, xStart, yStart, posZ); local xScreen2 = isoToScreenX(playerNum, xEnd , yEnd , posZ); local yScreen2 = isoToScreenY(playerNum, xEnd , yEnd , posZ); --LineDrawer.drawLine(xScreen1, yScreen1, xScreen2, yScreen2, r, g, b, a, var8); self:drawLine2( xScreen1, yScreen1, xScreen2, yScreen2, a, r, g, b) end end Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now