Attempt at a 3D parametric grapher

03052019, 02:12 AM
Post: #1




Attempt at a 3D parametric grapher
For some reason the absence of this app has really bugged me, in fact so much I've decided to try to make one. However, I've never really dealt with making anything in 3D, I don't understand how the equations actually work, and I certainly have never made a grapher before. Sounds like a typical ambitious project a newbie would attempt doesn't it? Yeah, that's kinda my shtick.
Anyways, I've done some research (wikipedia) and I think I understand the concept of 2D rotation. However, 3D rotation still breaks my brain, especially when I try of how this could work with more than just a simple cube example. I also looked around here and found this topic that contains this code: (11202014 07:59 AM)Han Wrote: Here's some code you can modify:Unfortunately, there are no comments within the code and I can't figure out how this all works. Definitely the part I'm most confused on is what do the variables represent? (The a,c,t0,tn,dt) I'd really appreciate it if someone could clarify the code I've posted, or provide a resource that I can learn how to program (or just graph) 3D parametric equations. Thanks! Cemetech  YouTube 

03052019, 06:20 AM
Post: #2




RE: Attempt at a 3D parametric grapher
hello,
if you look at the on calc help for triangle, there is a program there (in the example). it rotate a thetrahedron. but it would work with lines also... you can use it as a base... or Han excelent 3d grapher... cyrille Although I work for the HP calculator group, the views and opinions I post here are my own. I do not speak for HP. 

03052019, 11:44 PM
Post: #3




RE: Attempt at a 3D parametric grapher
Ok, so I think I understand how the rotation would work but how do I make the points? Do I have to choose certain x,y, and z value and just plug them in and solve for each x=,y=, and z= separately or is there a better way?
Cemetech  YouTube 

03062019, 04:36 AM
Post: #4




RE: Attempt at a 3D parametric grapher
That snippet of code was supposed to draw a 3D path defined by r(t)  basically a helix. The a represents the radius of the helix, c its height, and t0 and tn are the starting/ending angles of the helix.
If you want to create a 3D parametric grapher, you will need to generate your points, and use the TRIANGLE or TRIANGLE_P command. Read http://www.hpmuseum.org/forum/thread5122.html for a brief overview. Graph 3D  QPI  SolveSys 

03062019, 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 ab; 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. 

03072019, 04:28 AM
Post: #6




RE: Attempt at a 3D parametric grapher
Oh boy, that's a lot to take in. Thank you Han and cyrille, I really appreciate your replies! I'll get to work on this soon™! In all seriousness, I will work on this during my sparse free time and focus on it once a few real life projects are finished.
Cemetech  YouTube 

« Next Oldest  Next Newest »

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