Database Reference
In-Depth Information
SELECT height / tan(anglex) AS basex
),
widthy AS
(
SELECT height / tan(angley) AS basey
),
Now we have enough information to construct our pyramid:
iViewCone AS (
SELECT pyramidMaker(origin, basex::numeric,
basey::numeric, height) AS the_geom
FROM widthx, widthy
),
Wewillrequirethefollowingcodetorotateourcoderelativetopitch,roll,andbear-
ing:
iViewRotated AS (
SELECT ST_RotateXYZ(the_geom, pi() - pitch, 0
- roll, pi() - bearing, origin) AS the_geom
FROM iViewCone
)
SELECT the_geom FROM iViewRotated;
The whole functionis as follows:
CREATE OR REPLACE FUNCTION chp07.pbr(origin
geometry, pitch numeric, bearing numeric, roll
numeric, anglex numeric, angley numeric, height
numeric)
RETURNS geometry AS
$BODY$
WITH widthx AS
(
Search WWH ::




Custom Search