Post Reply 
Attempt at a 3D parametric grapher
03-06-2019, 07:02 AM
Post: #5
RE: Attempt at a 3D parametric grapher
Hello,

In your case, you will need to generate points doing somehting like:

points:= MAKELIST({fx(pa(I),pb(I)),fy(pa(I),pb(I)),fz(pa(I),pb(I))},I,0,99);

This just generates a list of points with x, y and z values being the result of user defined fx, fy, fz functions.
I use a single variable here for facility purpose, but you could use a double for loop (probaby better actually, but I was trying to show off) and use pa and pb to transform a value from 0 to 99 into 2 values varying from 0 to 9....

Then you need to make your triangle or line list. This one is actually much harder to make :-). In this list, you need to put doublets (or triplets) of point indices to specify your lists...

The beauty of the LINE_P and TRIANGLE_P functions is that they will do the rotations and other operations for you....

Cyrille

I have defined fx, fy, fz, pa and pb like so:
export fx(a,b)
begin
return a+b;
end;

export fy(a,b)
begin
return a-b;
end;

export fz(a,b)
begin
return a*b;
end;

export pa(a)
begin
return a mod 10;
end;

export pb(a)
begin
return ip(a/10);
end;

Although I work for the HP calculator group, the views and opinions I post here are my own. I do not speak for HP.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Attempt at a 3D parametric grapher - cyrille de brébisson - 03-06-2019 07:02 AM



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