POV-Ray : Newsgroups : povray.general : POV-Ray question regarding simple graphical output Server Time
27 Nov 2024 10:38:47 EST (-0500)
  POV-Ray question regarding simple graphical output (Message 1 to 9 of 9)  
From: Carl
Subject: POV-Ray question regarding simple graphical output
Date: 6 Dec 2008 15:25:00
Message: <web.493ade43cd7e8a76789948e10@news.povray.org>
Hello,

   About 10 years ago I wrote a poloyomino solver in Quick Basic 4.5.  It used
simple backtracking and simple graphical output and looked like a very watered
down version of this:

http://math.hws.edu/xJava/Pentominos_old/

   I no longer have my original QB45 code and I find myself needing to create
that program again.  However the only real programing I've done in the last 10
years as been with POV-Ray.  Vista won't even let QB45 go to full screen mode
so using it I now can only get text output and if I go to the work to recreate
my program I would like for it to atleast look pretty.  Can POV-Ray create real
simple 2D grapical output like QB45 to show the status of the board in real time
much as the Java applet does on the above link.  I don't need ray-traced
graphics for that but I do need a programing language I know and QB45 and
POV-Ray are pretty much it at the moment.  I taught myself POV-Ray so I could
also learn something new if need be and if that is the direction I should go
can anyone recommend a free language similiar to POV-Ray or simple basic.  I
took a peek at downloading the free version of visial basic and it was totally
unrecognizable to me.  It looked like point and click programming and I'm use
to typing if/then statements and creating for/next loops.

Any ideas?

Thanks,
Carl


Post a reply to this message

From: stbenge
Subject: Re: POV-Ray question regarding simple graphical output
Date: 6 Dec 2008 17:49:05
Message: <493b0161@news.povray.org>
Carl wrote:
> Any ideas?

POV-Ray is not very good at making dynamic programs. For instance, you 
can't have a simulation running forever. The best you can do is 
precalculate everything and have POV render the result.

Learning C++ really isn't all that difficult. Mastering it is though... 
My choice environment for creating C++ programs is Dev-Cpp. There are 
graphics libraries you can get for it. You can make graphics with SDL 
(Simple DirectMedia Layer) or with the HGE 2D game engine (v1.7 for 
DEV-Cpp) if you have DirectX 8.0 or greater installed on your computer. 
I like to use HGE, since the graphics are smooth and it's really easy to 
pick up and start creating things right away. It's also *really* fast. I 
haven't had much luck getting an HGE app to work with Vista, though from 
what I hear this is pretty much hit-and-miss. SDL is guaranteed to work, 
but will take some extra time to get it all set up.

Alternatively, you may try Euphoria which is an even simpler programming 
language. Its big selling points are the dynamic arrays and the fact 
that it's a very fast interpreted language. There are graphics libraries 
for DOS, and some others for Windows. Being on Vista though, I don't 
think you'll have much luck getting the DOS graphics libraries to work.

For whatever it's worth, I learned these programming languages in this 
order: QBasic>POV-Ray>Euphoria>C++.

Dev-Cpp: http://www.bloodshed.net/devcpp.html
SDL: http://devpaks.org/category.php?category=SDL (CRM32Pro or just SDL)
HGE: http://devpaks.org/category.php?category=SDL

Euphoria: http://devpaks.org/category.php?category=SDL

I recommend learning C++. It can be a very rewarding experience, and the 
speed you get is well worth it. If you get stuck with SDL, it's no big 
thing since it's fast at blitting at drawing pixels. If you want to make 
cellular automation sims, remember: C++ + SDL + arrays = good times :)

Sam


Post a reply to this message

From: stbenge
Subject: Re: POV-Ray question regarding simple graphical output
Date: 6 Dec 2008 17:54:23
Message: <493b029f@news.povray.org>
stbenge wrote:
> HGE: http://devpaks.org/category.php?category=SDL
> Euphoria: http://devpaks.org/category.php?category=SDL

Argh, messed up on those links. Here you go:

HGE: http://hge.relishgames.com/
Euphoria: http://www.rapideuphoria.com/

Sam


Post a reply to this message

From: Zeger Knaepen
Subject: Re: POV-Ray question regarding simple graphical output
Date: 6 Dec 2008 18:15:01
Message: <493b0775$1@news.povray.org>
if you're used to qb45, why don't you try freebasic? it's, as far as I 
understand, almost the same

cu!
-- 
#macro G(b,e)b+(e-b)*C/50#end#macro _(b,e,k,l)#local C=0;#while(C<50)
sphere{G(b,e)+3*z.1pigment{rgb G(k,l)}finish{ambient 1}}#local C=C+1;
#end#end _(y-x,y,x,x+y)_(y,-x-y,x+y,y)_(-x-y,-y,y,y+z)_(-y,y,y+z,x+y)
_(0x+y.5+y/2x)_(0x-y.5+y/2x)            // ZK http://www.povplace.com


Post a reply to this message

From: SharkD
Subject: Re: POV-Ray question regarding simple graphical output
Date: 6 Dec 2008 18:40:00
Message: <web.493b0d2fd17c5e397126680@news.povray.org>
"Carl" <car### [at] gmailcom> wrote:
> Hello,
>
>    About 10 years ago I wrote a poloyomino solver in Quick Basic 4.5.  It used
> simple backtracking and simple graphical output and looked like a very watered
> down version of this:
>
> http://math.hws.edu/xJava/Pentominos_old/
>
>    I no longer have my original QB45 code and I find myself needing to create
> that program again.  However the only real programing I've done in the last 10
> years as been with POV-Ray.  Vista won't even let QB45 go to full screen mode
> so using it I now can only get text output and if I go to the work to recreate
> my program I would like for it to atleast look pretty.  Can POV-Ray create real
> simple 2D grapical output like QB45 to show the status of the board in real time
> much as the Java applet does on the above link.  I don't need ray-traced
> graphics for that but I do need a programing language I know and QB45 and
> POV-Ray are pretty much it at the moment.  I taught myself POV-Ray so I could
> also learn something new if need be and if that is the direction I should go
> can anyone recommend a free language similiar to POV-Ray or simple basic.  I
> took a peek at downloading the free version of visial basic and it was totally
> unrecognizable to me.  It looked like point and click programming and I'm use
> to typing if/then statements and creating for/next loops.
>
> Any ideas?
>
> Thanks,
> Carl


For something like this you could use JavaScript. It runs on just about every
platform, features loose typing (you don't have to define variables as floats
or integers), doesn't need to be compiled (i.e. the source code is always
visible in case you like sharing your code) and can later be made to run in the
Windows Scripting Host environment if you require read/write access to the file
system.

To be honest, it's the only kind of programming I do, so I may be a bit biased.

:)

-Mike


Post a reply to this message

From: Larry Hudson
Subject: Re: POV-Ray question regarding simple graphical output
Date: 6 Dec 2008 20:19:01
Message: <493b2485$1@news.povray.org>
Carl wrote:
>    About 10 years ago I wrote a poloyomino solver in Quick Basic 4.5.  It used
> simple backtracking and simple graphical output and looked like a very watered
> down version of this:
> 
> http://math.hws.edu/xJava/Pentominos_old/
> 
>    I no longer have my original QB45 code and I find myself needing to create
> that program again.  

About 20+ years ago I wrote one in C, which I periodically rewrote every 
5 years or so as my programming skills improved.  Eventually I did it in 
C++ as well.  (Although these were specifically pentomino programs, not 
generic polyomino solvers.)  HOWEVER, these were all DOS-based programs 
using the text-mode screen, but with colored block characters.  I never 
did succeed in doing a real graphical version.  In addition, they used 
some direct-to-text-screen-writing routines that I also wrote myself. 
Besides displaying the results, it saved the solutions in text files as 
well.

I probably still have these sources floating around here someplace, but 
I don't know if I could find them -- I'm VERY disorganized here.    :-(

>                    However the only real programing I've done in the last 10
> years as been with POV-Ray.  

Personally, I would hesitate to call this a programming language.  It's 
programming-like, but too special purpose to think of it as a "real" PL. 
  My opinion only, of course.  But yes, it does look rather like C.

>                              Vista won't even let QB45 go to full screen mode
> so using it I now can only get text output and if I go to the work to recreate
> my program I would like for it to atleast look pretty.  

If you want to learn a "real" programming language, one that is often 
recommended as a first language is Python.  It's a beginner's language 
in that it's quite easy to learn, but it's a VERY effective and useful 
language (with graphics libraries as well).  It's much more versatile 
than any version of BASIC.  You might find this link an interesting 
read:  http://www.linuxjournal.com/article/3882
And Python is open-source and available free for Windows, Linux and the 
Mac.  Of course, this has nothing to do with your polyomino question...

> Thanks,
> Carl

      -=- Larry -=-


Post a reply to this message

From: stbenge
Subject: Re: POV-Ray question regarding simple graphical output
Date: 7 Dec 2008 00:20:47
Message: <493b5d2f@news.povray.org>
Larry Hudson wrote:
> You might find this link an interesting 
> read:  http://www.linuxjournal.com/article/3882
> And Python is open-source and available free for Windows, Linux and the 
> Mac.  Of course, this has nothing to do with your polyomino question...

After reading that article, I think I might just give Python a try. For 
some reason I always thought it was some rinky-dink scripting language 
with limited functionality, to be used for special purposes only. Now I 
know better. And it even has game libraries! I hope Pygame isn't a 
disappointment, like so many other game engines. This one actually has a 
big fan base and is being actively developed! Joy! :)

Sam


Post a reply to this message

From: Carl
Subject: Re: POV-Ray question regarding simple graphical output
Date: 7 Dec 2008 11:25:01
Message: <web.493bf6ebd17c5e789948e10@news.povray.org>
Larry Hudson <org### [at] yahoocom> wrote:
> About 20+ years ago I wrote one in C, which I periodically rewrote every
> 5 years or so as my programming skills improved.  Eventually I did it in
> C++ as well.  (Although these were specifically pentomino programs, not
> generic polyomino solvers.)

I started off with pentominos too but wrote the code general enough that it
could be used with just about all the polyominos.  I remember defining all the
shapes for the octominos but though my code did work with them it wasn't
optimized enough to be able to actually find solutions to any shapes in
anything close to a reasonable time.  I so wish I still had that code, I'm so
rusty at coding now it will take me a while just to figure out how I did the
backtracking.  If you are interested in the type of puzzle I'm trying to solve
with backtrack now here is an example:

http://www.smart-kit.com/s1512/untouchable-11-visual-spatial-puzzle-contest/

I'm listed there as Carl H and I've solved the hard and very hard versions by
hand but solving the Impossibly Hard version by hand is taking a long time.
The person who made the puzzle is aware of two solutions so it sounds like he
himself isn't aware of how many there might be so now I not only want to solve
it but to find out just how many solutions it has.

> HOWEVER, these were all DOS-based programs
> using the text-mode screen, but with colored block characters.  I never
> did succeed in doing a real graphical version.  In addition, they used
> some direct-to-text-screen-writing routines that I also wrote myself.
> Besides displaying the results, it saved the solutions in text files as
> well.

I think I'll start in Quick Basic 4.5 and also use colored block characters.  I
know how to get it to write the solutions to an ascii file as well.

> I probably still have these sources floating around here someplace, but
> I don't know if I could find them -- I'm VERY disorganized here.    :-(

Believe me I know, I'm the same way.  I've just spent the last two days scanning
about 500 3.5 inch floppies to see if I had a copy of my old program somewhere.
No luck.  So I'll be starting from square one.  If you can find your source code
I'd love to take a look at it.  I did some digging on-line as I remember when I
did this the first time I was pretty much following an example I had found.
The best I can find now is this:

http://ce.et.tudelft.nl/~knop/puzzles.html

And I think I can work from the pseudo code found there.

> If you want to learn a "real" programming language, one that is often
> recommended as a first language is Python.  It's a beginner's language
> in that it's quite easy to learn, but it's a VERY effective and useful
> language (with graphics libraries as well).  It's much more versatile
> than any version of BASIC.  You might find this link an interesting
> read:  http://www.linuxjournal.com/article/3882
> And Python is open-source and available free for Windows, Linux and the
> Mac.  Of course, this has nothing to do with your polyomino question...

Nice article.  You are the second person to recommend Python to me and I now
have it downloaded and installed on my PC.  That article was also a very
interesting read but looking at the sample code he posted here:

http://www.linuxjournal.com/files/linuxjournal.com/linuxjournal/articles/038/3882/3882l4.html

makes me nervous.  I'm sure he's doing something well over my head but it looks
like Greek to me.  I think I'll get some working code in Quick Basic first and
then start with some very very simple tasks in Python first and from there see
if I can port my code over and add the pretty graphics.

I've also read many good things about C and C++ and to be honest I'm not sure of
the difference between the two but I've never be able to find the time to try
and teach myself either and what exposure I have had makes me think I should
try to take a couse instead of jumping in by myself.  Python sounds like
something I might be able to teach myself on my own.  I did ok learning POV-Ray
and found the whole process fun and enjoyable.

Thanks for ALL the help everyone.  If anyone has any polyomino solving code they
are willing to share in any language I'm all ears.  If I get some working Quick
Basic 4.5 code that can solve the Untouchable 11 problem I'll be happy to share
it with anyone that is interested.  Maybe I can even find some help porting it
to something that makes it look pretty.

Again thanks for all the help.  The group here is one of the smartest and
friendliest I've ever sound on line.

Carl


Post a reply to this message

From: SharkD
Subject: Re: POV-Ray question regarding simple graphical output
Date: 8 Dec 2008 01:30:01
Message: <web.493cbe32d17c5ebb691c840@news.povray.org>
"SharkD" <nomail@nomail> wrote:
> For something like this you could use JavaScript. It runs on just about every
> platform, features loose typing (you don't have to define variables as floats
> or integers), doesn't need to be compiled (i.e. the source code is always
> visible in case you like sharing your code) and can later be made to run in the
> Windows Scripting Host environment if you require read/write access to the file
> system.
>
> To be honest, it's the only kind of programming I do, so I may be a bit biased.
>
> :)
>
> -Mike

It didn't occur to me that you might rather use Visual Basic instead of
JavaScript. Both languages can take advantage of the Windows Scripting Host
equally, so that's another option for you.

-Mike


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.