3

I want to represent the line y = 4x + 2. I suppose it has something to do with a function in python that gives pairs of values x-y and another that matches the points. I know how to do lines using the bge module, but I would like to do it in another way. Preferably I would like it to be a common way to represent other mathematical functions in 2D and 3D, and to be derivable and continuous. I would like to do this without using any addons.

Mr. Baldan
  • 547
  • 1
  • 5
  • 11
  • For displaying your plotted lines, I would suggest looking in the bgl (blender's OpenGL lib). – Bert VdB Jan 09 '18 at 09:45
  • 1
    Look at Scripting > Templates > Python > Operator Modal Draw shows both how to draw lines (with mouse) and text using bgl and blf respectively. Highly recommend going thru, and running, the templates when starting out with python for blender. – batFINGER Jan 09 '18 at 10:18
  • 1
    The only difference to using an addon and your script is who wrote it. The extra objects addon is included with blender releases and can make math function surfaces, the extra curve objects addon does a similar thing using curves. The addons are GPL, so you can always use (part of) the addon as a starting point for your script. You could also look at using sverchok for a node based option. Although, you don't mention if you want to create objects or just draw over the viewport? – sambler Jan 09 '18 at 15:20

0 Answers0