POV-Ray : Newsgroups : povray.general : an extraordinary rotation question : Re: an extraordinary rotation question Server Time
30 Jul 2024 14:25:18 EDT (-0400)
  Re: an extraordinary rotation question  
From: Chris B
Date: 24 Jun 2009 11:32:21
Message: <4a424705@news.povray.org>
"mysdn" <kam### [at] hotmailcom> wrote in message 
news:web.4a423009cfb6d60e4e47a1b0@news.povray.org...
> "Chris B" <nom### [at] nomailcom> wrote:
>
>> It might be easier to position your cabinets and slot them
>> together if the back left corner of a cabinet was always in a consistent
>> position.
>
> What do you mean by a consistent position?
>
> Wouldn't this position be <0,0,0> for each object then translated and 
> rotated to
> proper place within the Unions in the macro I'm trying to create.
> Thank you for your input, it's making a big big difference with every 
> post.
>

Yes, but in the modeller you need to decide which bit of a model is 
positioned at <0,0,0>.
If you centre two differently shaped door handle models so that their 
geometric centres are at <0,0,0>, then you have to perform different 
translations to fit each of them to a door. It's less work for you to model 
all handles so that the point at which they are attached to the door is at 
<0,0,0>, then all handles will be translated by the same amount to attach 
them to the doors. The same is true of taps and a similar logic can be 
applied with other fittings and fixtures to work out the optimum point on 
the model to position at <0,0,0>.


> How can I incorporate a handle.inc in below Union?

One way would be to add the name of the style of the handle into the file 
name, then pass the style name into the macro.
For example, if you pass in a style name of "roundgold" and the include file 
'handle_roundgold' contains the declaration for:

#declare Handle = mesh2 { ....}

Then you could have something like:

#macro Cabinet
(Width,Height,Depth,HasDoor,Door_OpenAngle,Cabinet_Texture,Door_Texture,HandleStyle)

#include concat("handle_",HandleStyle,".inc")

union {
    // Cabinet
    ... snip ...
    // Door
   #if (HasDoor)
       ... snip ...

      //Handle
      #if (HasHandle)
           object {Handle texture {...}}
      #end
   #end
}

Note that by nesting the '#if' for the handle inside the '#if' for the door 
you avoid having a handle with no door.


> PS: I'm thinking about opening a thread on macros,

That's probably a good idea, this thread has strayed a bit off the original 
topic.

> this has become an issue of
> creating hundreds of macros for me.

Personally I'd tend to try to avoid having hundreds of macros if it were me, 
but that's just down to programming style.

Regards,
Chris B.


Post a reply to this message

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