POV-Ray : Newsgroups : povray.advanced-users : cube renderer Server Time
29 Jul 2024 08:15:18 EDT (-0400)
  cube renderer (Message 1 to 9 of 9)  
From: Rohan Bernett
Subject: cube renderer
Date: 21 Oct 2002 00:50:05
Message: <web.3db386dd29981a6dd02c7b870@news.povray.org>
Is there any way to do a cube render automatically in POV-Ray? Sure I can do
it manually, but that involves making changes to the scene file, rendering,
change, and so on. even after rendering all the frames, I still have to
stick them together in Paint Shop Pro to get the final image.

Rohan _e_ii


Post a reply to this message

From: Slime
Subject: Re: cube renderer
Date: 21 Oct 2002 01:21:30
Message: <3db38eda$1@news.povray.org>
> Is there any way to do a cube render automatically in POV-Ray? Sure I can
do
> it manually, but that involves making changes to the scene file,
rendering,
> change, and so on. even after rendering all the frames, I still have to
> stick them together in Paint Shop Pro to get the final image.

Hmm, I've never heard of a cube render.

 - Slime
[ http://www.slimeland.com/ ]


Post a reply to this message

From: hughes, b 
Subject: Re: cube renderer
Date: 21 Oct 2002 01:41:33
Message: <3db3938d@news.povray.org>
"Rohan Bernett" <rox### [at] yahoocom> wrote in message
news:web.3db386dd29981a6dd02c7b870@news.povray.org...
> Is there any way to do a cube render automatically in POV-Ray? Sure I can
do
> it manually, but that involves making changes to the scene file,
rendering,
> change, and so on. even after rendering all the frames, I still have to
> stick them together in Paint Shop Pro to get the final image.

Maybe I can field this question, since it doesn't seem too "advanced". This
is really a povray.general or povray.newusers type of question.

I'll take a wild guess and say you must be either wanting to rotate a cube
(box) or gather up six images from six viewpoints. If not, maybe this won't
make perfect sense.

Let's say you wanted to get all 6 views of a cube which has been image
mapped differently on all sides like a photo-cube. The cube would be rotated
six ways according to clock value; or, as below, frame number. I'll use a
simple box in example, without actual 6 images since that takes a different
approach:

#switch (frame_number) // animate using frame_number keyword
#case (1)
box {-1,1
 texture {Image}
 rotate 0}
#break
#case (2)
box {-1,1
 texture {Image}
 rotate 90*x}
#break
#case (3)
box {-1,1
 texture {Image}
 rotate -90*x}
#break
#case (4)
box {-1,1
 texture {Image}
 rotate 90*y}
#break
#case (5)
box {-1,1
 texture {Image}
 rotate -90*y}
#break
#case (6)
box {-1,1
 texture {Image}
 rotate 180*y}
#break
#end

Main thing you're asking is how to animate though. So to get 6 frames put
+kfi1 +kff6 into the command-line, they mean initial and final frame
numbers; or use
Initial_Frame=1
Final_Frame=6
in a INI file, which you then apply via the toolbar Ini button (if Windows
anyway). That will render all six images instead of doing a single
rendering. A clock 0 to 1 is implied by default, meaning each frame advances
clock from 0 at the start to 1 at the end. So were keyword clock used
instead it would be fractions between 0 and 1. Unless, of course, you set
clock to run from 1 to 6 also, same as frames is.

Hopefully I have helped in some way. Or maybe I didn't understand the real
question. If it is about how to animate only, then look up "animation
output" in the Help or have a look at a tutorial here:
http://www.puzzlecraft.com/cm/ClockMod.html
Thanks to Ken Tyler for providing that link earlier elsewhere.


Post a reply to this message

From: Rohan Bernett
Subject: Re: cube renderer
Date: 21 Oct 2002 22:45:08
Message: <web.3db4babc54fc359218ccf4f70@news.povray.org>
Your clock method might work, but what if the camera isn't pointing straight
ahead (eg, location <10,20,10>, look_at <15,15,0>)? Simply rotating around
the axis won't work (I tried it manually, and got unworkable results). Is
it possible to get POV-Ray to generate all the frames and stick them
together, or do I have to generate the frames, then glue them together
manually?

Is there any other way to make an all-round-view (other than the fisheye
camera)?

Rohan _e_ii


Post a reply to this message

From: hughes, b 
Subject: Re: cube renderer
Date: 21 Oct 2002 23:38:43
Message: <3db4c843@news.povray.org>
"Rohan Bernett" <rox### [at] yahoocom> wrote in message
news:web.3db4babc54fc359218ccf4f70@news.povray.org...
> Your clock method might work, but what if the camera isn't pointing
straight
> ahead (eg, location <10,20,10>, look_at <15,15,0>)? Simply rotating around
> the axis won't work (I tried it manually, and got unworkable results). Is
> it possible to get POV-Ray to generate all the frames and stick them
> together, or do I have to generate the frames, then glue them together
> manually?
>
> Is there any other way to make an all-round-view (other than the fisheye
> camera)?

I'm sorry, I still don't understand the actual plan you have. Is it views of
a object on all sides by looking around it, or of an entire room such as in
a 360 degree panorama? If the latter, a panorama, then have a go with the
spherical camera as described in section 6.4.2.8 of the Scene Help.

Once you have the rendered frames done you must use another program to put
them together, yes. I use CMPEG a lot, an old command-line mpeg encoder (a
GUI front-end exists). Check the POV-Ray links for animation utilities,
there are many, at
http://www.povray.org/resources/

Back to the first thing you asked... look_at should be after any
transformations in the camera statement if you want it concentrated on a
specific place, or use a central vector of the main subject in the scene as
the look_at vector so they match instead. The way you described is like an
amusement park ride where the viewpoint remains fixed in a direction but not
fixed on something. It's a classic misconception and is told of in the FAQ,
section 9.1.2.3  http://www.povray.org/documentation/view/faq/

Bob


Post a reply to this message

From: Etienne Closset
Subject: Re: cube renderer
Date: 22 Oct 2002 05:10:02
Message: <3db515ea$1@news.povray.org>
I knew this one :
http://astronomy.swin.edu.au/~pbourke/rendering/cuberender/

also found this :
http://www.geocities.com/ResearchTriangle/Campus/2521/

very funny, I hope it helps.

etienne


Post a reply to this message

From: Rohan Bernett
Subject: Re: cube renderer
Date: 3 Nov 2002 21:05:04
Message: <web.3dc5d4f054fc3592b2769afa0@news.povray.org>
Yes, I am making a 360 degree panorama. The spherical camera won't be any
good for what I'm doing though. I have a cube panorama viewer, and it
requires the input image for the viewer to have six square faces of a cube
in the image.

The image parts are arranged like this:

|top  |     blank       |
|front|right|back |left |
|down |     blank       |

Is it possible to get POV-Ray to combine all 6 views into the one image in
this arrangement, or do I have to render the views as seperate files, and
arrange them manually?

Rohan _e_ii


Post a reply to this message

From: hughes, b 
Subject: Re: cube renderer
Date: 4 Nov 2002 01:40:18
Message: <3dc61652@news.povray.org>
"Rohan Bernett" <rox### [at] yahoocom> wrote in message
news:web.3dc5d4f054fc3592b2769afa0@news.povray.org...
> Yes, I am making a 360 degree panorama. The spherical camera won't be any
> good for what I'm doing though. I have a cube panorama viewer, and it
> requires the input image for the viewer to have six square faces of a cube
> in the image.
>
> |top  |     blank       |
> |front|right|back |left |
> |down |     blank       |
>
> Is it possible to get POV-Ray to combine all 6 views into the one image in
> this arrangement, or do I have to render the views as seperate files, and
> arrange them manually?

Hmmm, yes, it would need to be the 6 views first but then you can have
POV-Ray put them together for the final image by using orthographic camera
projection and a plane with the image_maps placed onto it.

And I guess you could use a 90 degree field of view (gee, I don't know what
90 degrees is in 'angle' number) for the each rendering within that set of 6
to get the image maps, and hopefully the perspective will be worked out by
that cubed panoramic viewer.

Anyway, so basically the idea would be to animate the camera to shift
look_at points to all directions needed using #switch and #range as frame
numbers change from 1 to 6. Then, on the seventh, apply those into a layered
texture (image_map using once keyword so as not to overlap) having each
translated accordingly.

What you can't do is get a single rendering to do this... unless someone
comes up with a mirror trick or something. Well, seems to me that there's a
kind of viewport-patched POV somewhere out there that probably could. I
couldn't say though.
--
Farewell,
Bob


Post a reply to this message

From: hughes, b 
Subject: Re: cube renderer : trial run
Date: 4 Nov 2002 05:45:17
Message: <3dc64fbd@news.povray.org>
I wasn't too clear headed about this last reply so I went about trying this
out and although I got it all into a single animation there's still a
problem, namely the render resolution. Without the ini_option feature, as
found in MegaPOV, I couldn't have image size change to accomodate the final
image collection.

I'm posting what I tried anyhow, just in case you find a way around that.
Such as doing two runs instead of one.

/* example scene "seen" on all sides */

//cmd:+fn +w300 +h300 +kfi1 +kff7 +ki1 +kf7 +oC:\images\image

global_settings {
 max_trace_level 7
}

// ----------------------------------------

camera {
#if (frame_number=7)
 orthographic
#end
 location <0, 0, 0>
#if (frame_number=7)
 right x*4
 up y*3
#else
 right x
 angle 90
#end
 look_at <0, 0, 1>

#switch (frame_number)
#case (1)
 rotate -90*x
#break
#case (2)
 rotate 0*x
#break
#case (3)
 rotate <0,90,0>
#break
#case (4)
 rotate <0,180,0>
#break
#case (5)
 rotate <0,-90,0>
#break
#case (6)
 rotate 90*x
#break
#case (7)
 rotate 0*x
#break
#end
}

// ----------------------------------------

#if (frame_number!=7)

// regular part of scene

light_source {
 0,1
}

intersection {
plane {
 y, 1
 pigment { color rgb <1,0,0> }
}
plane {
 -y, 1
 pigment { color rgb <1,1,0> }
}
plane {
 x, 1
 pigment { color rgb <1,0,1> }
}
plane {
 -x, 1
 pigment { color rgb <0,1,0> }
}
plane {
 z, 1
 pigment { color rgb <0,1,1> }
}
plane {
 -z, 1
 pigment { color rgb <0,0,1> }
}
}

#else

// image collection part of scene

plane {
 z, 1
texture {
 pigment {
    image_map {
     png "image1.png" once
    }
    translate <-2,0.5,0>
 }
 finish {ambient 1 diffuse 0}
}
texture {
 pigment {
    image_map {
     png "image2.png" once
    }
    translate <-2,-0.5,0>
 }
 finish {ambient 1 diffuse 0}
}
texture {
 pigment {
    image_map {
     png "image3.png" once
    }
    translate <-1,-0.5,0>
 }
 finish {ambient 1 diffuse 0}
}
texture {
 pigment {
    image_map {
     png "image4.png" once
    }
    translate <0,-0.5,0>
 }
 finish {ambient 1 diffuse 0}
}
texture {
 pigment {
    image_map {
     png "image5.png" once
    }
    translate <1,-0.5,0>
 }
 finish {ambient 1 diffuse 0}
}
texture {
 pigment {
    image_map {
     png "image6.png" once
    }
    translate <-2,-1.5,0>
 }
 finish {ambient 1 diffuse 0}
}
}

#end


Post a reply to this message

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