POV-Ray : Newsgroups : povray.binaries.images : RSOCP by ChatGPT Server Time
5 Nov 2024 05:23:34 EST (-0500)
  RSOCP by ChatGPT (Message 1 to 4 of 4)  
From: Christian Froeschlin
Subject: RSOCP by ChatGPT
Date: 6 Dec 2022 19:17:08
Message: <638fdb84$1@news.povray.org>
I had seen some prompts on Twitter to generate C / python code and
wanted to see if it knew about more obscure languages as well so here
is ChatGPT's introductory RSCOP image :-)

My prompt was "Write a POV-Ray script to render a reflective sphere over 
a checkered plane"

On first glance the output looked reasonable but it didn't in fact
compile, it attempted to generate the checker pigment as

   checker(CheckerColor1, CheckerColor2);

and a plane object with a location instead of direction + distance.

Logical problems included having sphere and camera both inside the
plane y = 0 and the light source on the far side of the sphere.

After minimal manual fixes I got the attached result. Interesting
development but world domination still seems a few years off.


Post a reply to this message


Attachments:
Download 'rsocp.png' (22 KB)

Preview of image 'rsocp.png'
rsocp.png


 

From: Christian Froeschlin
Subject: Re: RSOCP by ChatGPT
Date: 6 Dec 2022 19:23:55
Message: <638fdd1b@news.povray.org>
Explanation and Code as produced by ChatGPT:


"This script will create a red sphere that is reflective, and place it 
over a checkerboard-patterned plane. The camera is positioned to look at 
the sphere and plane, and a light source is added to illuminate the scene."


// Declare the height and width of the image
#declare ImageWidth = 500;
#declare ImageHeight = 500;

// Declare the camera position and direction
#declare CameraLocation = <0, 0, -10>;
#declare CameraDirection = <0, 0, 1>;

// Declare the light source position and color
#declare LightSourceLocation = <-10, 10, 10>;
#declare LightSourceColor = <1, 1, 1>;

// Declare the sphere's position, radius, and color
#declare SphereLocation = <0, 0, 0>;
#declare SphereRadius = 2;
#declare SphereColor = <1, 0, 0>;

// Declare the plane's position and size
#declare PlaneLocation = <0, 0, 0>;
#declare PlaneSize = 10;

// Declare the checker pattern's colors
#declare CheckerColor1 = <1, 1, 1>;
#declare CheckerColor2 = <0, 0, 0>;

// Create the checker pattern
#declare CheckerPattern = checker(CheckerColor1, CheckerColor2);

// Create the plane
plane {
     PlaneLocation,
     // Use the checker pattern for the plane's texture
     texture {
         pigment { CheckerPattern }
     }
}

// Create the sphere
sphere {
     SphereLocation,
     SphereRadius,
     // Set the sphere's color and make it reflective
     texture {
         pigment { SphereColor }
         finish {
             reflection { 0.8 }
         }
     }
}

// Create the camera
camera {
     location    CameraLocation
     direction   CameraDirection
     right       x*ImageWidth/ImageHeight
     up          y
}

// Create the light source
light_source {
     LightSourceLocation
     color       LightSourceColor
}


Post a reply to this message

From: Robert McGregor
Subject: Re: RSOCP by ChatGPT
Date: 9 Dec 2022 19:50:00
Message: <web.6393d6947537f19087570eabd4644d08@news.povray.org>
Christian Froeschlin <chr### [at] chrfrde> wrote:
> Explanation and Code as produced by ChatGPT:
>
>
> "This script will create a red sphere that is reflective, and place it
> over a checkerboard-patterned plane. The camera is positioned to look at
> the sphere and plane, and a light source is added to illuminate the scene."
>

I was just watching a YouTube video about creating Blender scripts with this new
tool ChatGPT, pretty amazing stuff it can do already - it was only released a
week ago...


Post a reply to this message

From: Chris R
Subject: Re: RSOCP by ChatGPT
Date: 16 Jun 2023 08:55:00
Message: <web.648c5b777537f19064326bc25cc1b6e@news.povray.org>
"Robert McGregor" <rob### [at] mcgregorfineartcom> wrote:
> Christian Froeschlin <chr### [at] chrfrde> wrote:
> > Explanation and Code as produced by ChatGPT:
> >
> >
> > "This script will create a red sphere that is reflective, and place it
> > over a checkerboard-patterned plane. The camera is positioned to look at
> > the sphere and plane, and a light source is added to illuminate the scene."
> >
>
> I was just watching a YouTube video about creating Blender scripts with this new
> tool ChatGPT, pretty amazing stuff it can do already - it was only released a
> week ago...

I just started playing around with this as a general exploration of the
capabilities of code generation in Chat GPT.  I asked it for a rounded,
truncated cone.  It got the truncated cone part, but missed the tori needed to
round the top and bottom edges.

I then asked it to use an isosurface instead of a cone.  The isosurface function
it generated had something like this:

function {
   float r = 0.5;
   sqrt(x*x+z*z) - r
}

which is obviously not correct SDL syntax.  I wonder where it picked that up?

-- Chris R.


Post a reply to this message

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