POV-Ray : Newsgroups : povray.general : Post something Server Time
28 Mar 2026 16:48:15 EDT (-0400)
  Post something (Message 11 to 20 of 22)  
<<< Previous 10 Messages Goto Latest 10 Messages Next 2 Messages >>>
From: Josh English
Subject: Re: Post something
Date: 22 Mar 2026 19:29:06
Message: <69c07b42@news.povray.org>
On 3/20/2026 4:21 PM, Bald Eagle wrote:
> OK "POV-Ray community,"
> 
> Let's make a concerted effort to get some of those things out of your heads and
> off of your hard drives and onto the forum during the next week.
> 
> Post something.  It doesn't matter what it is.
> Really.   Just post it.  Here.
> 

I've been on-and-off playing with creating cities on the irregular grids 
I was playing with last year.

Buildings align to the "roads" defined by the grid.


Post a reply to this message


Attachments:
Download 'fillrect.png' (66 KB)

Preview of image 'fillrect.png'
fillrect.png


 

From: laser
Subject: Re: Post something
Date: 23 Mar 2026 11:15:00
Message: <web.69c157d44fed6263b5e70e3d617a575b@news.povray.org>
"Bald Eagle" <cre### [at] netscapenet> wrote:

> Post something.  It doesn't matter what it is.
> Really.   Just post it.  Here.
>

I'm modifying a compiler I wrote that was for an assignment in my compilers
college course many years ago.  I've expanded the grammar to be a fully usable
language rather than a "toy" language.  So, of course, I just had to create a
raytracer for it.  Here's the source code written in my language:

{
/* Integer loop + shading vars */
i_x = 0; i_y = 0;
i_shade = 0;
i_check = 0;
i_mod2 = 0;

/* Camera origin */
f_sx = 0.0; f_sy = 0.1; f_sz = 5.5;

/* Light direction (will normalize) */
#f_lx = -2.0; f_ly = 3.0; f_lz = -1.0;
f_lx = -2.0; f_ly = 3.0; f_lz = 2.0;

/* Ray direction */
f_dx = 0.0; f_dy = 0.0; f_dz = 0.0;

/* 2nd Sphere position */
f_sp_x = 1.75; f_sp_y = 0.0; f_sp_z = -2.0;

/* Sphere radiuses */
f_sp1_r = 1.2; f_sp2_r = 0.6;

/* Sphere intersection */
f_b = 0.0; f_c = 0.0; f_disc = 0.0; f_t = 0.0;

/* plane height */
f_ply = -1.6;

/* Normals and points */
f_nx = 0.0; f_ny = 0.0; f_nz = 0.0;
f_px = 0.0; f_py = 0.0; f_pz = 0.0;

/* Helpers */
f_len = 0.0; f_dot = 0.0; f_spec = 0.0; f_tmp = 0.0;
f_fx = 0.0; f_fz = 0.0;

/* Shadow ray vars */
f_sdx = 0.0; f_sdy = 0.0; f_sdz = 0.0;
f_tb = 0.0; f_tc = 0.0; f_tdisc = 0.0; f_tshadow = 0.0;

/* Normalize light direction once */
f_len = sqrt(f_lx*f_lx + f_ly*f_ly + f_lz*f_lz);
f_lx = f_lx / f_len; f_ly = f_ly / f_len; f_lz = f_lz / f_len;

f_aspect = 1.0;

print "P6\n640 480\n255\n";
/* Image loop */
for i_y = -240 to 239 do
 {
 for i_x = -320 to 319 do
  {
  /* Ray direction from camera through pixel */
  f_dx = float(i_x) / 490.0;
  f_dy = -float(i_y) * f_aspect / 490.0;
  f_dz = -1.0;

  /* Normalize ray direction */
  f_len = sqrt(f_dx*f_dx + f_dy*f_dy + f_dz*f_dz);
  f_dx = f_dx / f_len;
  f_dy = f_dy / f_len;
  f_dz = f_dz / f_len;

  /* Sphere intersection: center at (0,0,0), radius 1.2 */
  f_tx = f_sx;
  f_ty = f_sy;
  f_tz = f_sz;
  f_b = 2.0 * (f_dx*f_tx + f_dy*f_ty + f_dz*f_tz);
  f_c = f_tx*f_tx + f_ty*f_ty + f_tz*f_tz - f_sp1_r;

  f_disc = f_b*f_b - 4.0*f_c;

  if f_disc >= 0.0 then
   {
   /* Hit sphere: nearest t */
   f_t = (-f_b - sqrt(f_disc)) / 2.0;
   if f_t <= 0.0 then
    {
    /* Behind camera: treat as no sphere hit, fall through */
    f_disc = -1.0;
    }
   else
    {
    f_obj_red = 0.9;
    f_obj_green = 0.9;
    f_obj_blue = 0.0;
    }
   }

  /* Sphere intersection: center at (f_sp_x,f_sp_y,f_sp_z), radius .6 */
  f_tx2 = f_sx - f_sp_x;
  f_ty2 = f_sy - f_sp_y;
  f_tz2 = f_sz - f_sp_z;
  f_b = 2.0 * (f_dx*f_tx2 + f_dy*f_ty2 + f_dz*f_tz2);
  f_c = f_tx2*f_tx2 + f_ty2*f_ty2 + f_tz2*f_tz2 - f_sp2_r;

  f_disc2 = f_b*f_b - 4.0*f_c;

  if f_disc2 >= 0.0 then
   {
   /* Hit sphere: nearest t */
   f_t2 = (-f_b - sqrt(f_disc2)) / 2.0;
   if f_t2 > 0.0 then
    {
    b_sp1=(f_disc<0.0); #(f_t<0.0); /* boolean */
    b_sp2=(f_t2<f_t); /* boolean */
    if b_sp1+b_sp2 then /* boolean + = or */
     {
     f_obj_red = 0.0;
     f_obj_green = 0.9;
     f_obj_blue = 0.0;
     f_disc = f_disc2;
     f_t = f_t2;
     f_tx = f_tx2;
     f_ty = f_ty2;
     f_tz = f_tz2;
     }
    }
   }

  if f_disc < 0.0 then
   {
   /* No sphere hit: try ground plane y = -1.6 */

   if f_dy == 0.0 then
    {
    /* Ray parallel to plane: background */
    printc 0;
    printc 90;
    printc 130;
    }
   else
    {
    f_t = (f_ply - f_sy) / f_dy;
    if f_t <= 0.0 then
     {
     /* Plane behind camera */
     printc 0;
     printc 90;
     printc 130;
     }
    else
     {
     /* Hit point on plane */
     f_px = f_sx + f_dx*f_t;
     f_py = f_ply;
     f_pz = f_sz + f_dz*f_t;

     /* Checkerboard: floor(px), floor(pz) using int */
     f_fx = float(int(f_px));
     if f_px < 0.0 then f_fx = f_fx - 1.0;

     f_fz = float(int(f_pz));
     if f_pz < 0.0 then f_fz = f_fz - 1.0;

     i_check = (int(f_fx + f_fz)) % 2;
     if (i_check == 0) then { f_red=0.75; f_green=0.0; f_blue=0.0; }
     else { f_red=0.75; f_green=0.75; f_blue=0.75; }

     /* Shadow from sphere onto plane:
     cast ray from plane point toward light,
     check if it hits sphere before light. */

     f_sdx = f_lx;
     f_sdy = f_ly;
     f_sdz = f_lz;

     /* Sphere intersection from plane point:
     ray: P + t*L, sphere at origin, radius 1 */

     f_tb = 2.0 * (f_sdx*f_px + f_sdy*f_py + f_sdz*f_pz);
     f_tc = f_px*f_px + f_py*f_py + f_pz*f_pz - f_sp1_r;
     f_tdisc = f_tb*f_tb - 4.0*f_tc;

     if f_tdisc > 0.0 then
      {
      f_tshadow = (-f_tb - sqrt(f_tdisc)) / 2.0;
      if f_tshadow > 0.0 then
       {
       /* In shadow: darken */
       f_red = f_red * 0.5;
       f_green = f_green * 0.5;
       f_blue = f_blue * 0.5;
       }
      }

     f_tx = f_px - f_sp_x;
     f_ty = f_py - f_sp_y;
     f_tz = f_pz - f_sp_z;

     f_tb = 2.0 * (f_sdx*f_tx + f_sdy*f_ty + f_sdz*f_tz);
     f_tc = f_tx*f_tx + f_ty*f_ty + f_tz*f_tz - f_sp2_r;
     f_tdisc = f_tb*f_tb - 4.0*f_tc;

     if f_tdisc > 0.0 then
      {
      f_tshadow = (-f_tb - sqrt(f_tdisc)) / 2.0;
      if f_tshadow > 0.0 then
       {
       /* In shadow: darken */
       f_red = f_red * 0.5;
       f_green = f_green * 0.5;
       f_blue = f_blue * 0.5;
       }
      }

     i_red=int(f_red * 255.0);
     i_green=int(f_green * 255.0);
     i_blue=int(f_blue * 255.0);

     if i_red < 0 then i_red = 0;
     if i_red > 255 then i_red = 255;
     if i_green < 0 then i_green = 0;
     if i_green > 255 then i_green = 255;
     if i_blue < 0 then i_blue = 0;
     if i_blue > 255 then i_blue = 255;

     printc i_red;
     printc i_green;
     printc i_blue;
     }
    }
   }
  else
   {
   /* Sphere shading */

   /* Hit point */
   f_px = f_tx + f_dx*f_t;
   f_py = f_ty + f_dy*f_t;
   f_pz = f_tz + f_dz*f_t;

   /* Normal at sphere */
   f_nx = f_px;
   f_ny = f_py;
   f_nz = f_pz;

   f_len = sqrt(f_nx*f_nx + f_ny*f_ny + f_nz*f_nz);
   f_nx = f_nx / f_len;
   f_ny = f_ny / f_len;
   f_nz = f_nz / f_len;

   /* Diffuse term */
   f_dot = f_nx*f_lx + f_ny*f_ly + f_nz*f_lz;
   if f_dot < 0.0 then f_dot = 0.0;

   /* Specular: reflection of light around normal, dotted with view dir (-ray)
*/
   f_tmp = 2.0 * f_dot;
   f_fx = f_tmp*f_nx - f_lx;
   f_fz = f_tmp*f_nz - f_lz;
   f_len = f_tmp*f_ny - f_ly;  /* reuse f_len as ry */

   /* view dir is -ray: (-dx, -dy, -dz) */
   f_spec = f_fx*(-f_dx) + f_len*(-f_dy) + f_fz*(-f_dz);
   if f_spec < 0.0 then f_spec = 0.0;
   f_spec = f_spec * f_spec;

   /* Combine diffuse + specular + small ambient */
   f_dot = 0.12 + .6*f_dot + 0.3*f_spec;

   if f_dot < 0.0 then f_dot = 0.0;
   if f_dot > 1.0 then f_dot = 1.0;

   i_red = int(f_obj_red * f_dot * 255.0);
   i_green = int(f_obj_green * f_dot * 255.0);
   i_blue = int(f_obj_blue * f_dot * 255.0);

   if i_red < 0 then i_red = 0;
   if i_red > 255 then i_red = 255;
   if i_green < 0 then i_green = 0;
   if i_green > 255 then i_green = 255;
   if i_blue < 0 then i_blue = 0;
   if i_blue > 255 then i_blue = 255;

   printc i_red;
   printc i_green;
   printc i_blue;
   }
  }
 }
}

There are no specific variable type declarations.  The type is based on the
first letter of the variable (i for integer, f for floating point, s for string,
and b for boolean).
# are line comments and /* */ are comment blocks.  The resulting compiled
x86/x64 program (either Windows or Linux) outputs a PPM (netpbm) image file.
The code is not that great because I haven't fully implemented functions (so no
recursion), and there's no pointers, no structs, and no arrays.  Here's the
resulting image:


Post a reply to this message


Attachments:
Download 'rayout.png' (18 KB)

Preview of image 'rayout.png'
rayout.png


 

From: Bald Eagle
Subject: Re: Post something
Date: 23 Mar 2026 13:45:00
Message: <web.69c17b454fed62636750f02625979125@news.povray.org>
"laser" <nomail@nomail> wrote:

> I'm modifying a compiler I wrote that was for an assignment in my compilers
> college course many years ago.  I've expanded the grammar to be a fully usable
> language rather than a "toy" language.  So, of course, I just had to create a
> raytracer for it.

Excellent.
Curious what you do professionally?

Have you seen the raytracer that you can write in SDL?
I've done about 3 different versions of that so far.

- BE


Post a reply to this message

From: jr
Subject: Re: Post something
Date: 23 Mar 2026 16:30:00
Message: <web.69c1a2084fed626348bf72fa6cde94f1@news.povray.org>
"jr" <cre### [at] gmailcom> wrote:
> ...
> a POV-Ray documentation tool I'm playing with.  it requires version 3.7.0.8
> documentation (the HTML files) installed, ...

link to an archive with a copy of my 'povray-3.7.0.8' docs, in case :-)

<drive.google.com/file/d/1ZN8ZHOi5x6GWfSATUtcgrMtsO2ochFRw/view?usp=sharing>


regards, jr.


Post a reply to this message

From: laser
Subject: Re: Post something
Date: 24 Mar 2026 12:05:00
Message: <web.69c2b50a4fed6263b5e70e3d617a575b@news.povray.org>
"Bald Eagle" <cre### [at] netscapenet> wrote:
> "laser" <nomail@nomail> wrote:
>
> > I'm modifying a compiler I wrote that was for an assignment in my compilers
> > college course many years ago.  I've expanded the grammar to be a fully usable
> > language rather than a "toy" language.  So, of course, I just had to create a
> > raytracer for it.
>
> Excellent.
> Curious what you do professionally?
>
> Have you seen the raytracer that you can write in SDL?
> I've done about 3 different versions of that so far.
>
> - BE

Thanks.  I'm a programmer, but compiler writing is definitely outside of the
range of my normal coding,  Though configuration script (and similar) writing
(and therefore designing the script language) isn't (but that's interpreted not
compiled).

I probably have seen the raytracer you mention, but I can't quite remember what
it was like right now.  I mostly go right to the "Image Digest" and don't always
read the posts (but I do see your name a lot :-) )

If you're interested in seeing some of my work, etc. you can see examples on my
youtube channel (lot's of tutorials now, and also my earlier videos are
raytracings.  I only have 42 videos so it's not hard to look through the whole
channel):  http://www.youtube.com/MrMcSoftware/videos

An x86 assembly raytracer (different than the one I posted an image of) I coded
is covered in my assembly language videos and a little bit in my "My Projects:
Pathtracing, Raytracer (x86 Assembly, Amiga, Linux & Windows), Tesla Coil Use &
More" video,  This raytracer was based on my assembly raytracer for a CPU I
designed - it first appeared in my "My Logisim CPU / Computer - Now With
Floating Point (FPU) (Fractals, Raytracer, Etc.)" video.  And a GLSL version of
this raytracer is at my shadertoy page:
https://www.shadertoy.com/user/mrmcsoftware (I think that link will provide a
link to it).  Sorry to do so much promoting, but it's all along the same lines
of coding a raytracer in an unorthodox way.


Post a reply to this message

From: laser
Subject: Re: Post something
Date: 24 Mar 2026 18:35:00
Message: <web.69c311074fed6263b5e70e3d617a575b@news.povray.org>
"Bald Eagle" <cre### [at] netscapenet> wrote:
> "laser" <nomail@nomail> wrote:
>
> > I'm modifying a compiler I wrote that was for an assignment in my compilers
> > college course many years ago.  I've expanded the grammar to be a fully usable
> > language rather than a "toy" language.  So, of course, I just had to create a
> > raytracer for it.
>
> Excellent.
> Curious what you do professionally?
>
> Have you seen the raytracer that you can write in SDL?
> I've done about 3 different versions of that so far.
>
> - BE

I'm a programmer.  A compiler is outside of my normal range of coding, though I
have written various configuration (and similar) scripting languages (but that's
interpreted not compiled).

I probably have seen the raytracer you mention, but I can't quite remember what
it was like right now.  I mostly go right to "Image Digest" and don't always
read the posts (but I have seen your name often :-) )

If you want to see some of the stuff I've done, you can see some examples on my
youtube channel (mostly tutorials lately, and my earlier videos contain many
raytracings) (my channel only has 42 videos, so it wouldn't take long to look
through): <www.youtube.com/MrMcSoftware/videos>

An x86 assembly raytracer I wrote (not the one I first posted about) is covered
in my assembly language videos and a little bit in my "My Projects: Pathtracing,
Raytracer (x86 Assembly, Amiga, Linux & Windows), Tesla Coil Use & More" video -
it was based on my assembly raytracer I wrote for a CPU I designed and first
appeared in my video "My Logisim CPU / Computer - Now With Floating Point (FPU)
(Fractals, Raytracer, Etc.)".  And a GLSL version can be viewed on my shadertoy
page: <www.shadertoy.com/user/mrmcsoftware>
Sorry about all the self-promoting, but they all are along the same lines we're
talking about - unorthodox ways of doing raytracing.


Post a reply to this message

From: Bald Eagle
Subject: Re: Post something
Date: 25 Mar 2026 09:55:00
Message: <web.69c3e85b4fed62637ca0eb7925979125@news.povray.org>
"laser" <nomail@nomail> wrote:

> I'm a programmer.

I am . . . shocked.  ;)


> I probably have seen the raytracer you mention, but I can't quite remember what
> it was like right now.

https://wiki.povray.org/content/Documentation:Tutorial_Section_3.8#SDL_tutorial:_A_raytracer

> I mostly go right to "Image Digest" and don't always
> read the posts

I'm sure if you've just been skimming, then you must be a very busy guy.

> (but I have seen your name often :-) )

Well, yeah.  I've been playing with this for a long time now, and have
progressed from kindergarten level stick figure renders to refactoring and
debugging the source code.

>
> If you want to see some of the stuff I've done,
Thanks - I look forward to reading/watching all that.
(Loved the Pink Floyd article!)

> An x86 assembly raytracer I wrote

Jeez.  I haven't written assembly since I bought a pamphlet that taught me to
write assembly for my Commodore Vic-20 and save the code on a tape drive.  :O

> And a GLSL version can be viewed on my shadertoy
> page: <www.shadertoy.com/user/mrmcsoftware>

What's up with shadertoy?  I can't get the site to open on any machine or
browser that I've tried.  For a long while now.
It's one of my primary references for helping me get my brain solidly into
functional-programming mode. :(

> Sorry about all the self-promoting, but they all are along the same lines we're
> talking about - unorthodox ways of doing raytracing.

Hopefully you make regular visits - it's always nice to see other people's work
- for inspiration, learning, and just simple enjoyment.

Nice to finally meet you.
- BE


Post a reply to this message

From: laser
Subject: Re: Post something
Date: 25 Mar 2026 12:15:00
Message: <web.69c409484fed6263b5e70e3d617a575b@news.povray.org>
"Bald Eagle" <cre### [at] netscapenet> wrote:
> "laser" <nomail@nomail> wrote:

> > I probably have seen the raytracer you mention, but I can't quite remember what
> > it was like right now.
>
>
https://wiki.povray.org/content/Documentation:Tutorial_Section_3.8#SDL_tutorial:_A_raytracer
>

That looks rather interesting - thanks for the link.  I got a kick out of the
"colored mesh" part.

> > I mostly go right to "Image Digest" and don't always
> > read the posts
>
> I'm sure if you've just been skimming, then you must be a very busy guy.

Yeah, my todo list is getting longer.  But there's often too much information to
go through.  I've been using the internet since 1987 (pre-http) so I've seen
both lack of information and too much information.  Too much is better,  This
page is a nice throwback to my USENET days though.

> > If you want to see some of the stuff I've done,
> Thanks - I look forward to reading/watching all that.
> (Loved the Pink Floyd article!)

Glad to hear it.  I always hope Roger Waters would read it and let me know what
he thinks.

> > An x86 assembly raytracer I wrote
>
> Jeez.  I haven't written assembly since I bought a pamphlet that taught me to
> write assembly for my Commodore Vic-20 and save the code on a tape drive.  :O

I guess then we're both about the same age - a VIC-20 is how I started,  A tape
drive came later unfortunately - after a failed attempt to create a tape
recorder interface that I saw at a science fair.  Maybe the interface worked but
the VIC-20 didn't like my cassette recorder since I think a tape recorder
interface I bought didn't work either.

> What's up with shadertoy?  I can't get the site to open on any machine or
> browser that I've tried.  For a long while now.
> It's one of my primary references for helping me get my brain solidly into
> functional-programming mode. :(

A few months or more ago they added the human verification/check because they
were getting hit by too much traffic or something.  They felt it was caused by
AI scrapers,  I don't know if they would have done it if someone on twitter
hadn't recommended adding the human check,  It is very annoying, but the site
does work for me once I wait the rather long time (not "it's never going to
work" long though) to get to the checkbox,  If your browser is too old (I'm not
saying yours is, just pointing out a possible issue), you will get an infinite
loop of trying to verify with no checkbox ever showing up.

> Hopefully you make regular visits - it's always nice to see other people's work
> - for inspiration, learning, and just simple enjoyment.
>
> Nice to finally meet you.
> - BE

Nice to meet/talk to you as well.  Yeah, inspiration and learning are very
important.
- Mark


Post a reply to this message

From: tTh
Subject: Re: Post something
Date: 26 Mar 2026 15:26:50
Message: <69c5887a$1@news.povray.org>
On 3/21/26 00:21, Bald Eagle wrote:

> Post something.  It doesn't matter what it is.
> Really.   Just post it.  Here.

    Ok ok. I've been working on this animation for two years,
    and i now publish this version, just a work in progress,
    but is a nice land for a lot of enhancements.

    https://tube.interhacker.space/w/rNEQbXXZGZFnoabG7uB6FR

-- 
**                                                            **
*                      tTh des Bourtoulots                     *
*                  http://maison.tth.netlib.re/                *
**                                                            **


Post a reply to this message

From: Bald Eagle
Subject: Re: Post something
Date: 27 Mar 2026 13:15:00
Message: <web.69c6baba4fed6263537ff30a25979125@news.povray.org>
"laser" <nomail@nomail> wrote:

> I guess then we're both about the same age - a VIC-20 is how I started,  A tape
> drive came later unfortunately - after a failed attempt to create a tape
> recorder interface that I saw at a science fair.  Maybe the interface worked but
> the VIC-20 didn't like my cassette recorder since I think a tape recorder
> interface I bought didn't work either.

Well, I started like everyone else using TRS-80's, and my first home computer
was a Timex Sinclair 1000.  Then a VIC-20, Then an Atari 800XL.
I didn't buy myself a "real" computer until after college.

I miss the joystick port.  That was like my own interface to the outside world.
I suppose I could just use a Raspberry Pi, but being able to have a simple
makeshift I/O port was really fun.

> > What's up with shadertoy?
>
> ... It is very annoying, but the site
> does work for me once I wait the rather long time (not "it's never going to
> work" long though) to get to the checkbox,

I only get a black page that says "Bad request"

> If your browser is too old
I'm using M$ Edge.

- BE


Post a reply to this message

<<< Previous 10 Messages Goto Latest 10 Messages Next 2 Messages >>>

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