POV-Ray : Newsgroups : povray.newusers : Making a 3D tab style dialog Server Time
29 Jul 2024 12:26:42 EDT (-0400)
  Making a 3D tab style dialog (Message 1 to 3 of 3)  
From: Whookie
Subject: Making a 3D tab style dialog
Date: 10 Feb 2006 04:45:01
Message: <web.43ec5f6475b2471ec79699df0@news.povray.org>
Hi all!
I'm completely new to rendering and am trying to make a "tab style" box for
a web design. Something like the tabs at
http://gforge.org/projects/modauthgforge/
(the curved style of the "overview", "tracker", ... tabs)

So far I have build the body with a box and cylinders at the left, right and
bottom edges. The lower left and right corners are spheres.
I've also build one side of a tab (the straight one, with a box, cylinders
at the left and top and a sphere as top/left corner)
but I'm completely lost on the gently curved slope of the tab. How can I
make the rounded 3D plate of the slope??

tia
Whookie


Post a reply to this message

From: Chris B
Subject: Re: Making a 3D tab style dialog
Date: 10 Feb 2006 07:24:39
Message: <43ec8607$1@news.povray.org>
"Whookie" <gus### [at] hotmailcom> wrote in message 
news:web.43ec5f6475b2471ec79699df0@news.povray.org...
> Hi all!
> I'm completely new to rendering and am trying to make a "tab style" box 
> for
> a web design. Something like the tabs at
> http://gforge.org/projects/modauthgforge/
> (the curved style of the "overview", "tracker", ... tabs)
>
> So far I have build the body with a box and cylinders at the left, right 
> and
> bottom edges. The lower left and right corners are spheres.
> I've also build one side of a tab (the straight one, with a box, cylinders
> at the left and top and a sphere as top/left corner)
> but I'm completely lost on the gently curved slope of the tab. How can I
> make the rounded 3D plate of the slope??
>
> tia
> Whookie
>
>

Hi Whookie,

I would tend to go for a union of a torus and a cylinder at each corner 
rather than a sphere. It gives you more flexibility for defining the radius 
of the curve.

To get the slanted edge I would recommend doing a union of a cylinder and a 
box, then rotating them both together. You need to be careful about how you 
rotate the edge to keep it in line with the torus. In the example below, 
I've defined the cylinder at the same height as the radius of the torus 
above the origin, then rotated it at the origin before translating it by the 
same amount as the torus it needs to join up with. This should keep the 
start of the cylinder aligned to the rim of the torus, irrespective of the 
slant of the edge.

In the following example I've added a pigment to the torus and a bit of 
transparency to the main part of the tab so you can see the construction.
The alternative camera gives a closeup of the right corner.

Hope this helps.
Chris B.


camera {location <2,0,-5> look_at <2,0,0>}
//camera {location <3.5,1.2,-1> look_at <3.5,1,0>}

light_source{<   0,   10,-400> rgb 1}

#local TabThickness = 0.2;
#local TabRadius    = 0.3;
#local TabHeight    = 1;
#local TabLeft      = 0;
#local TabWidth     = 4;
#local TabSlant     = 42;

#local TabCorner    = union {
  torus {TabRadius,TabThickness/2 rotate  x*90 pigment {color rgbt <0,1,1>}}
  cylinder {<0,0,-TabThickness/2><0,0,TabThickness/2>,TabRadius}
}
#local TabTopEdge   = cylinder {<TabLeft+TabRadius, 
TabHeight,0><TabLeft+TabWidth-TabRadius, TabHeight,0>,TabThickness/2}
#local TabLeftEdge  = cylinder {<TabLeft, TabHeight-TabRadius,0><TabLeft, 
0,0>,TabThickness/2}
#local TabRightEdge = union {
  cylinder {<0,TabRadius,0><TabWidth,TabRadius,0>,TabThickness/2}
  box {<0,-TabHeight,-TabThickness/2><TabWidth,TabRadius,TabThickness/2>}
  pigment {color rgbt <1,1,0,0.4>}
}


#declare Tab = union {
  object {TabCorner translate <TabLeft+TabRadius,TabHeight-TabRadius,0>}
  object {TabTopEdge}
  object {TabLeftEdge}
  object {TabCorner translate 
<TabLeft+TabWidth-TabRadius,TabHeight-TabRadius,0>}
  intersection {
    object {TabRightEdge rotate -z*TabSlant translate 
<TabLeft+TabWidth-TabRadius,TabHeight-TabRadius,0>}
    box 
{<TabLeft+TabWidth-TabRadius,0,-TabThickness><TabLeft+TabWidth*2,TabHeight*1.1,TabThickness>}
  }
  box 
{<TabLeft,0,-TabThickness/2><TabLeft+TabWidth,TabHeight-TabRadius,TabThickness/2>}
  box 
{<TabLeft+TabRadius,0,-TabThickness/2><TabLeft+TabWidth-TabRadius,TabHeight,TabThickness/2>}
}

object {Tab pigment {color rgbt <1,1,1,0.4>}}


Post a reply to this message

From: Whookie
Subject: Re: Making a 3D tab style dialog
Date: 13 Feb 2006 17:25:01
Message: <web.43f106c586be52683dc1fe960@news.povray.org>
Whoa!
Thats great! Many, many thanx

Whookie


Post a reply to this message

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