|
|
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'
|
|
|
|
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
|
|
|
|
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
|
|
|
|
"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
|
|