Post Reply 
Advanced form of LINE_P
01-03-2024, 07:25 PM
Post: #1
Advanced form of LINE_P
In the on-calc help, you can find: "The advanced form of LINE_P allows the rendering of multiple lines at a time with a potential 3D transformation of the points that define the line. This is mostly used if you have a set of vertices and lines and want to display them all at once (faster)".

Can someone provide a working example of a simple LINE_P call that draws two straight lines?
I've tried with lists and matrices, but nothing seemed to work.
Find all posts by this user
Quote this message in a reply
01-03-2024, 09:50 PM
Post: #2
RE: Advanced form of LINE_P
The following program draws two lines:
  • first line between the points p1 (x1=80, y1=60) and p2 (x2=160, y2=120)
  • second line between the points p2 (x2=160, y2=120) and p3 (x3=100, y3=180)

Code:
#pragma mode( separator(.,;) integer(h32) )
EXPORT Demo_LINE_P()
BEGIN

//// LINE_P - Advanced form to render multiple lines
RECT();  // Clear screen
LINE_P({{80,60},{160,120},{100,180}},{{1,2},{2,3}},{-1}); // draw two lines
WAIT();

END;
Find all posts by this user
Quote this message in a reply
01-04-2024, 08:40 AM
Post: #3
RE: Advanced form of LINE_P
(01-03-2024 09:50 PM)Didier Lachieze Wrote:  The following program draws two lines:
[...]
Code:
#pragma mode( separator(.,;) integer(h32) )
EXPORT Demo_LINE_P()
BEGIN

//// LINE_P - Advanced form to render multiple lines
RECT();  // Clear screen
LINE_P({{80,60},{160,120},{100,180}},{{1,2},{2,3}},{-1}); // draw two lines
WAIT();

END;

My mistake was that I focused too much on the format of the definition of points and lines and didn't notice that "-1" should be used as a list element, whereas I was entering it as a direct parameter. Now everything is working correctly.
Thanks.
Find all posts by this user
Quote this message in a reply
Post Reply 




User(s) browsing this thread: 2 Guest(s)