POV-Ray : Newsgroups : povray.newusers : Round box : Re: Round box Server Time
6 Oct 2024 03:39:53 EDT (-0400)
  Re: Round box  
From: Tor Olav Kristensen
Date: 4 Jan 2022 15:15:00
Message: <web.61d4a9b8b1626a3251748ca189db30a9@news.povray.org>
"Cabesa" <adr### [at] gmailcom> wrote:
> Ive been trying to use the round_box shape but i dont really understand how to.
> If someone is willing to explain the way the shapes and the "macro?" idrk what
> it is, id appreciate it a lot.

I suggest that you read these pages:

    "HowTo:Use macros and loops"
    https://wiki.povray.org/content/HowTo:Use_macros_and_loops

    "Reference:Shapes.inc"
    https://wiki.povray.org/content/Reference:Shapes.inc

    "2.2.2.8 User Defined Macros"
    https://www.povray.org/documentation/view/3.7.0/243/

    "2.7.12.1 shapes.inc"
    http://www.povray.org/documentation/view/3.7.1/468/

- and then you can try this:

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

#version 3.7;

global_settings { assumed_gamma 1.0 }

#include "colors.inc"
#include "shapes.inc" // For the Round_Box() macro

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

#declare pA = <-2,  0, -1>;  // A corner
#declare pB = <+2, +1, +1>;  // The opposite corner
#declare EdgeAndcornerRadius = 0.25;
#declare UseMerge = false;

object {
    Round_Box(pA, pB, EdgeAndcornerRadius, UseMerge)
    texture {
        pigment { color DarkSlateBlue }
        normal {
            radial
            sine_wave
            frequency 30
            scale 0.25*<1, 1, 1>
        }
        finish { phong 0.5 }
    }
    rotate -35*y
}

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

background { color Gray30 + Cyan/5 }

light_source {
    100*<-5, 20, -10>
    color White
}

camera {
    location <0, 3, -5>
    look_at <0, 0, 0>
}

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

--
Tor Olav


Post a reply to this message

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