POV-Ray : Newsgroups : povray.general : how to define my own object Server Time
1 Aug 2024 08:21:41 EDT (-0400)
  how to define my own object (Message 1 to 3 of 3)  
From: wenxu Zhang
Subject: how to define my own object
Date: 22 Feb 2006 15:35:00
Message: <web.43fcca03d76f1b8dc0094d250@news.povray.org>
Dear friends,
How can I define my own object. For example, I like to define my own object
called two_balls, which includes two spheres. Then I can use it as the
usual one, say, placing it somewhere, etc.
Thank you


Post a reply to this message

From: Merrin Cullen
Subject: Re: how to define my own object
Date: 22 Feb 2006 15:45:19
Message: <43fccd5f@news.povray.org>
Simply declare the object:

#declare two_balls =
    union{
        sphere{<-5,0,0>,5 pigment{Blue}}
        sphere{<5,0,0>,5 pigment{Red}}
    }

When you wnat to use two_balls:

object{two_balls }

You can include transforms such as rotate and translate in the object
statement. If your spheres are not pigmented in dividually or in the union,
you can even apply a pigment/texture in the object statement.

"wenxu Zhang" <wxz### [at] hotmailcom> wrote in message
news:web.43fcca03d76f1b8dc0094d250@news.povray.org...
> Dear friends,
> How can I define my own object. For example, I like to define my own
object
> called two_balls, which includes two spheres. Then I can use it as the
> usual one, say, placing it somewhere, etc.
> Thank you
>
>
>


Post a reply to this message

From: Marc Jacquier
Subject: Re: how to define my own object
Date: 22 Feb 2006 16:29:24
Message: <43fcd7b4@news.povray.org>

news:web.43fcca03d76f1b8dc0094d250@news.povray.org...
> Dear friends,
> How can I define my own object. For example, I like to define my own
object
> called two_balls, which includes two spheres. Then I can use it as the
> usual one, say, placing it somewhere, etc.
> Thank you
>

As posted Merrin...

In addition, I suggest you have look at the documentation section
Constructive Solid Geometry.
You'll learn very interesting stuff

http://www.povray.org/documentation/view/3.6.1/302/ and following


Marc


Post a reply to this message

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