Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 22

Thread: Super Function Plotter: Inspired from pages 41 - 64

  1. #11
    thinBasic MVPs kryton9's Avatar
    Join Date
    Nov 2006
    Location
    Naples, Florida & Duluth, Georgia
    Age
    67
    Posts
    3,869
    Rep Power
    404

    Re: Super Function Plotter: Inspired from pages 41 - 64

    The code is updated in the first post.

    Thanks Stan. I got more steam today to get it to a point I like now. Back and forth with Petr helped solve a tough problem I had yesterday. Glad you are enjoying it. It is even more fun now.
    Acer Notebook: Win 10 Home 64 Bit, Core i7-4702MQ @ 2.2Ghz, 12 GB RAM, nVidia GTX 760M and Intel HD 4600
    Raspberry Pi 3: Raspbian OS use for Home Samba Server and Test HTTP Server

  2. #12
    Member sblank's Avatar
    Join Date
    Feb 2010
    Location
    Wayne City, Illinois
    Posts
    80
    Rep Power
    23

    Re: Super Function Plotter: Inspired from pages 41 - 64

    Yes! That's great... and I like "Miller's Madness" in the thumbnail as well!

    This is very cool and I'll share it with my students tomorrow (today is a holiday in Illinois). They'll have fun "playing." You'd be surprised how much math they learn when they don't think about learning math

    Good work, Kent... nicely done!

    Stan

    Quote Originally Posted by kent sarikaya
    The code is updated in the first post.

    Thanks Stan. I got more steam today to get it to a point I like now. Back and forth with Petr helped solve a tough problem I had yesterday. Glad you are enjoying it. It is even more fun now.

  3. #13
    thinBasic MVPs kryton9's Avatar
    Join Date
    Nov 2006
    Location
    Naples, Florida & Duluth, Georgia
    Age
    67
    Posts
    3,869
    Rep Power
    404

    Re: Super Function Plotter: Inspired from pages 41 - 64

    Thanks Stan, I am glad you like it. In reviewing and trying to do some more of the equations from your book, I came up with some more ideas for the plotter.
    Since this current version is functional and adequate for a lot of them, we can call this version 1.

    Version 2 will be a different enough to being its own new function plotter model, so there will be 2 models of the plotter, and I am sure as we go on there will be more models in the future

    Acer Notebook: Win 10 Home 64 Bit, Core i7-4702MQ @ 2.2Ghz, 12 GB RAM, nVidia GTX 760M and Intel HD 4600
    Raspberry Pi 3: Raspbian OS use for Home Samba Server and Test HTTP Server

  4. #14

    Re: Super Function Plotter: Inspired from pages 41 - 64


    Hi Kent,

    Looking at your plotter code, I notice you refresh the plot using the WM_TIMER signal. You could improve the CPU work load by refreshing whenever a control button is pressed instead. All you need is to set a Global refresh flag variable which can be cleared after a refresh.

    For very demanding functions Oxgen will certainly help. The best way to do it is set up a source string containing all the parameters and code necessary to calculate the entire plot and fill thinBasic arrays with the results. Then TBGL can process these results separately - either using direct vertex commands or using the forthcoming vertex array processing.

    Does that make sense?

    Charles

  5. #15
    thinBasic MVPs kryton9's Avatar
    Join Date
    Nov 2006
    Location
    Naples, Florida & Duluth, Georgia
    Age
    67
    Posts
    3,869
    Rep Power
    404

    Re: Super Function Plotter: Inspired from pages 41 - 64

    I sort of understand what you are saying. I am writing the new version all from scratch, when I get to a point where I get it working I will work on bringing oxygen in. I will study all the examples and when I get stuck on specifics I will ask for help. Thanks for helping already and the new samples.

    A previous version was updating all the time, but Petr recommended using the timer to take the load off of the cpu. That Miller's madness equation is a good one to test with as anything below 0.1 steps it slows down quite a bit. We can use that when the new version is ready to optimize.
    Acer Notebook: Win 10 Home 64 Bit, Core i7-4702MQ @ 2.2Ghz, 12 GB RAM, nVidia GTX 760M and Intel HD 4600
    Raspberry Pi 3: Raspbian OS use for Home Samba Server and Test HTTP Server

  6. #16
    thinBasic MVPs kryton9's Avatar
    Join Date
    Nov 2006
    Location
    Naples, Florida & Duluth, Georgia
    Age
    67
    Posts
    3,869
    Rep Power
    404

    Super Function Plotter 2

    Here is the next generation. Unfortunately I spent twice as many days as I planned on it and could not implement lesson saving and loading. It can be a good test app for ideas on making ones own or adding to this version. But it has more things to play with and get cool looking graphics via math. Enjoy!
    Attached Files Attached Files
    Acer Notebook: Win 10 Home 64 Bit, Core i7-4702MQ @ 2.2Ghz, 12 GB RAM, nVidia GTX 760M and Intel HD 4600
    Raspberry Pi 3: Raspbian OS use for Home Samba Server and Test HTTP Server

  7. #17
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    7,128
    Rep Power
    732

    Re: Super Function Plotter: Inspired from pages 41 - 64

    Hi Kent,

    nice example, and pretty wild function plot, I can tell you!

    There is one aesthetical detail - the graphics are drawn over the status bar, making the image flicker.
    So better to create statusbar first, use control get size to retrieve its true height, and then subtract it from the canvas height.

    Maybe also good to incorporate the idea of redrawing image only on change, as Charles suggested.
    Once changed, you can cache it to display list or gbuffer, and then you just redraw using single command when necessary.

    I am sorry to lead you off the path with the timer approach, it works well for animated scene, but for static one the Charles way is better.

    Regarding storing/saving ... I think INI file could serve well here.

    I liked the layout too.


    Petr
    Learn 3D graphics with ThinBASIC, learn TBGL!
    Windows 10 64bit - Intel Core i5-3350P @ 3.1GHz - 16 GB RAM - NVIDIA GeForce GTX 1050 Ti 4GB

  8. #18
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    57
    Posts
    8,777
    Rep Power
    10

    Re: Super Function Plotter: Inspired from pages 41 - 64

    Great layout.
    Only problem: big CPU load. Almost all CPU is consumed by redrawing
    www.thinbasic.com | www.thinbasic.com/community/ | help.thinbasic.com
    Windows 10 Pro for Workstations 64bit - 32 GB - Intel(R) Xeon(R) W-10855M CPU @ 2.80GHz - NVIDIA Quadro RTX 3000

  9. #19
    thinBasic MVPs kryton9's Avatar
    Join Date
    Nov 2006
    Location
    Naples, Florida & Duluth, Georgia
    Age
    67
    Posts
    3,869
    Rep Power
    404

    Re: Super Function Plotter: Inspired from pages 41 - 64

    I was using the status bar for development. I guess it will be easier to just remove it. I don't want to put anymore time into it. I will fix the cpu load by not making it dynamic. It will be the easiest way.
    I will upload the changes soon. Thanks for comments and feedback.
    Acer Notebook: Win 10 Home 64 Bit, Core i7-4702MQ @ 2.2Ghz, 12 GB RAM, nVidia GTX 760M and Intel HD 4600
    Raspberry Pi 3: Raspbian OS use for Home Samba Server and Test HTTP Server

  10. #20
    thinBasic MVPs kryton9's Avatar
    Join Date
    Nov 2006
    Location
    Naples, Florida & Duluth, Georgia
    Age
    67
    Posts
    3,869
    Rep Power
    404

    Re: Super Function Plotter: Inspired from pages 41 - 64

    I commented out the status bar lines. If anyone else wants to use it for debugging, just uncomment the lines.

    The cpu usage. I just upped the timer trigger from .2 seconds to 2 seconds. This way the dynamic update is in place and the cpu is not working
    full time.

    The updated file is attached to the original post for super function plotter2 or just click on the link below to get the file attachment directly from the post.
    http://community.thinbasic.com/index....0;attach=6724
    Acer Notebook: Win 10 Home 64 Bit, Core i7-4702MQ @ 2.2Ghz, 12 GB RAM, nVidia GTX 760M and Intel HD 4600
    Raspberry Pi 3: Raspbian OS use for Home Samba Server and Test HTTP Server

Page 2 of 3 FirstFirst 123 LastLast

Similar Threads

  1. Super Demos!
    By Reinking in forum TBGL General
    Replies: 4
    Last Post: 26-05-2006, 22:18

Members who have read this thread: 0

There are no members to list at the moment.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •