POV-Ray : Newsgroups : povray.beta-test : "Bad allocation" in POV-Ray RC3 for WIndows : Re: "Bad allocation" in POV-Ray RC3 for WIndows Server Time
28 Sep 2024 14:48:22 EDT (-0400)
  Re: "Bad allocation" in POV-Ray RC3 for WIndows  
From: Tor Olav Kristensen
Date: 15 Apr 2011 17:35:00
Message: <web.4da8b9cded9ecc0c734aecd0@news.povray.org>
Jaime Vives Piqueres <jai### [at] ignoranciaorg> wrote:

> > ... (And if I have understood things right, a mesh camera needs a lot
> > of triangles...)
>
>    Not necessarily: you can use an uv-mapped mesh with distribution #3
> and the smooth option. But I don't know if this is convenient in your
> case...

Thank you for the tip Jaime.

I hadn't got around to experiment with that distribution type yet.
(Mostly because I find their descriptions a bit difficult to understand.)

But now I have just tried it with just 2 triangles in a mesh.
- and it works fine =)

If anybody else is interested, here's how I did it:

// ===== 1 ======= 2 ======= 3 ======= 4 ======= 5 ======= 6 ======= 7

#version 3.7;

#include "colors.inc"

// ===== 1 ======= 2 ======= 3 ======= 4 ======= 5 ======= 6 ======= 7

#declare H = 2;
#declare W = H*image_width/image_height;

#declare SimpleMesh =
  mesh2 {
    vertex_vectors {
      4,
      <-W, -H, 0>,
      <+W, -H, 0>,
      <+W, +H, 0>,
      <-W, +H, 0>
    }
    uv_vectors {
      4,
      <0, 0>,
      <1, 0>,
      <1, 1>,
      <0, 1>
    }
    face_indices {
      2,
      <0, 1, 2>,
      <2, 3, 0>
    }
  }

camera {
  mesh_camera {
    1
    3
    mesh2 { SimpleMesh }
  }
}

// ===== 1 ======= 2 ======= 3 ======= 4 ======= 5 ======= 6 ======= 7

sphere {
  -10*z, 1
  pigment { color Cyan }
}

light_source {
  <1, 1, 0>*10
  color White
}

background { color (Gray + Blue)/4 }

// ===== 1 ======= 2 ======= 3 ======= 4 ======= 5 ======= 6 ======= 7

--
Tor Olav
http://subcube.com


Post a reply to this message

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