Difference between revisions of "User:Le Forgeron/warp"
Le Forgeron (talk | contribs) |
Le Forgeron (talk | contribs) |
||
(2 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
{{User:Le_Forgeron/HgPovray38/available}} | {{User:Le_Forgeron/HgPovray38/available}} | ||
+ | |||
+ | == hyperbolic disc warp == | ||
+ | perform an hyperbolic projection on a disc: Poincaré Hyperbolic disk. | ||
+ | * radius of the disc can be adjusted | ||
+ | * inside of the disc can be scaled before the projection | ||
+ | |||
+ | <source lang="pov"> | ||
+ | warp { disc [radius FLOAT] [scale FLOAT] } | ||
+ | </source> | ||
+ | |||
+ | |||
+ | {| border="1" | ||
+ | | | ||
+ | <source lang="pov"> | ||
+ | #version 3.8; | ||
+ | global_settings{ assumed_gamma 1.0 } | ||
+ | |||
+ | camera { | ||
+ | location <5, -20, 14> | ||
+ | direction y | ||
+ | sky z | ||
+ | up z | ||
+ | right image_width*x/image_height | ||
+ | look_at 0 | ||
+ | angle 15 | ||
+ | } | ||
+ | |||
+ | #default{ finish { emission 0.5 reflection 0.5 } } | ||
+ | |||
+ | cylinder { 0.5*z, -0.5*z, 3 | ||
+ | texture { checker | ||
+ | texture { pigment { rgb <0.3,0.9,0> } } | ||
+ | texture { pigment { rgb <1,0.0,0.5> } } | ||
+ | warp { disc radius 2.75 scale 0.75 } | ||
+ | } | ||
+ | } | ||
+ | light_source { <0, -10, 20> 1 } | ||
+ | </source> | ||
+ | | | ||
+ | [[Image:LeForgeron_warpDisc.png]] | ||
+ | |} | ||
== rotation warp == | == rotation warp == |
Latest revision as of 10:39, 6 September 2020
- Everything about HgPovray38 in User:Le_Forgeron/HgPovray38
- Code is available on branch hgpovray38 at https://github.com/LeForgeron/povray
hyperbolic disc warp
perform an hyperbolic projection on a disc: Poincaré Hyperbolic disk.
- radius of the disc can be adjusted
- inside of the disc can be scaled before the projection
warp { disc [radius FLOAT] [scale FLOAT] }
#version 3.8;
global_settings{ assumed_gamma 1.0 }
camera {
location <5, -20, 14>
direction y
sky z
up z
right image_width*x/image_height
look_at 0
angle 15
}
#default{ finish { emission 0.5 reflection 0.5 } }
cylinder { 0.5*z, -0.5*z, 3
texture { checker
texture { pigment { rgb <0.3,0.9,0> } }
texture { pigment { rgb <1,0.0,0.5> } }
warp { disc radius 2.75 scale 0.75 }
}
}
light_source { <0, -10, 20> 1 }
|
rotation warp
rotate along the z axis
warp { rotate PerUnit }
#version 3.8;
global_settings{ assumed_gamma 1.0 }
camera {
location <5, -20, 14>
direction y
sky z
up z
right image_width*x/image_height
look_at 0
angle 20
}
#default{ finish { emission 0.5 reflection 0.5 } }
cylinder { 3.5*z, -3.5*z, 3
texture { checker
texture { pigment { red 1 } }
texture { pigment { green 1 } }
warp { rotate -1/29 }
}
}
light_source { <0, -10, 20> 1 }
|
direct to a surface
As a curiosity, the warp can be inversed by adding inverse
after the last parameter.
cone
wrap around a circular cone (oriented along y axis) with apex at origin point and a radius of unit_base one unit away from that apex. The x=0 half-plane (for z>0) remains itself.
Each axis of parameter is the multiplying factor for that axe.
warp { cone <origin>,unit_base,<parameter> }
cone { <0,2,0>,0,<0,0,0>,1
texture { pigment { My_pigment
warp { cone <0,2,0>,0.5,<3,5,7> }
}
}
}
|
cone { <0,2,0>,0.5,<0,0,0>,1
texture { pigment { My_pigment
warp { cone <0,4,0>,0.25,<3,5,7> }
}
}
}
|
cylinder
wrap around a cylinder (oriented along y axis) with <0,0,0> moved at origin point. The x=0 half-plane (for z>0) remains itself.
Each axis of parameter is the multiplying factor for that axe.
warp { cylinder <origin>,<parameter> }
cylinder { <0,0,0>,<0,2,0>,1
texture { pigment { My_pigment
warp { cylinder <0,1,0>,<3,5,7> }
}
}
}
|
|
sphere
wrap around a sphere (main axe being the y axe) with <0,0,0> moved at origin point. The x=0 half-plane (for z>0) remains itself.
Each axis of parameter is the multiplying factor for that axe.
warp { sphere <origin>,<parameter> }
sphere { <0,0.5,0>,1
texture { pigment { My_pigment
warp { sphere <0,0.5,0>,<3,5,7> }
}
}
}
|
|
torus
wrap around a torus (oriented along y axis) with <0,0,0> moved at origin point and a major radius of major. The x=0 half-plane (for z>0) remains itself.
Each axis of parameter is the multiplying factor for that axe.
warp { torus <origin>,major,<parameter> }
torus { 0.55,0.45
texture { pigment { My_pigment
warp { torus <0,0,0>,0.55,<3,5,7> }
}
}
}
|
|