The King Posted October 21, 2016 Posted October 21, 2016 (edited) how to make polygon near a tree or object something like this or like alek's woodcutter which has a square over the tree anyone have the code for it ? Edited October 21, 2016 by The King
Precise Posted October 21, 2016 Posted October 21, 2016 get the position of the tree, make an instance of minimaptileDestination using that position and draw the destination
Explv Posted October 21, 2016 Posted October 21, 2016 (edited) how to make polygon near a tree or object something like this or like alek's woodcutter which has a square over the tree anyone have the code for it ? Something like: graphics.drawPolygon(treePosition.getPolygon(getBot())) Edited October 21, 2016 by Explv
Saiyan Posted October 21, 2016 Posted October 21, 2016 (edited) I tried making a polygon on the tree with the tree pos but it wasn't accurate and didnt cover/wrap the tree so if you want to do a bounding box or something instead it'd be something like titan.draw(treevariable.getModel().getBoundingBox(treevariable.getGridX(), treevariable.getGridY(), treevariable.getZ())); where titan. is my onPaint reference e.g (Graphics2D titan) treevariable is your tree variable you get the gist I tried mate, sorry if you do however want to still try the polygon stuff it's titan.draw(treevariable.getPosition().getPolygon(getBot())); Edited October 21, 2016 by Saiyan 1
House Posted October 21, 2016 Posted October 21, 2016 Google http://osbot.org/forum/topic/46435-draw-object-model/
Alek Posted October 21, 2016 Posted October 21, 2016 From Alek's woodcutter (pieced together): GraphicUtilities.getModelBoundingBox(bot, o.getGridX(), o.getGridY(), o.getZ(), o.getModel()); g.drawRect(rectangle.x, rectangle.y, rectangle.width, rectangle.height);
The King Posted October 21, 2016 Author Posted October 21, 2016 (edited) I tried making a polygon on the tree with the tree pos but it wasn't accurate and didnt cover/wrap the tree so if you want to do a bounding box or something instead it'd be something like titan.draw(treevariable.getModel().getBoundingBox(treevariable.getGridX(), treevariable.getGridY(), treevariable.getZ())); where titan. is my onPaint reference e.g (Graphics2D titan) treevariable is your tree variable you get the gist I tried mate, sorry if you do however want to still try the polygon stuff it's titan.draw(treevariable.getPosition().getPolygon(getBot())); Thanks bro it works From Alek's woodcutter (pieced together): GraphicUtilities.getModelBoundingBox(bot, o.getGridX(), o.getGridY(), o.getZ(), o.getModel()); g.drawRect(rectangle.x, rectangle.y, rectangle.width, rectangle.height); Bro thanks for that but it didn't work with me correct me if i am wrong, 2d graphics is not working in the tree we need 3d. Edited October 21, 2016 by The King