Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

3D Projection

11 views
Skip to first unread message

Daniel Kolb

unread,
Sep 13, 1999, 3:00:00 AM9/13/99
to
Hi
I don't know if this is the right place for this question.
I'm searching for a formula for 3D central-projection
thanx

Jens-Peer Kuska

unread,
Sep 15, 1999, 3:00:00 AM9/15/99
to
Hi,

it is not the right place, comp.graphics.algorithms is the correct one.
You have to say where your camera is placed, what is your viewing depth
and how is the camera oriented in space.

Any standard book of 3d graphics will give you the transformation
between the different coordinate systems .. In homogeneous coordinates with
a projection plane:

t
^
|
|
l<-----+-----> r
|
|
V
b

and a near plane position at n (perpendicular to the axis above) and a
far plane
position f


You have the matrix

{{2 n/(r-l), 0, (r+l)/(r-l), 0},
{ 0 , 2 n/(t-b), (t+b)/(t-b), 0},
{ 0, 0, -(f+n)/(f-n),-2 f n/(f-n)},
{ 0 0, -1, 0}}

where your point has the coordinates {x,y,z,1}

Hope that helps
Jens

adam....@hillsdale.edu

unread,
Sep 15, 1999, 3:00:00 AM9/15/99
to
In article <7ri605$8...@smc.vnet.net>,

Daniel Kolb <danie...@gmx.de> wrote:
> Hi
> I don't know if this is the right place for this question.
> I'm searching for a formula for 3D central-projection
> thanx
>
>
I am not sure if this is what you want. But the following
code "projects" a function of 3 dimensions onot the corresponding
planes.

Notes:

1. I apply the option EdgeForm[] to eliminate the grid lines. They
seem to clutter up the plot. Especially for large values of PlotPoints.
2. Picking larger values for PlotPoints reduces the graininess of the
resulting plot, but of course requires more processing time and memory.

Adam Smith

-----------------------------------------------------------------
In[1]:=
<<Graphics`

In[2]:=
m = 1;
n = 2;
p = 3;
thing = ParametricPlot3D[ {
{t,u,0,{EdgeForm[],Hue[ (1-Sin[m Pi t] Sin[n Pi u])/2]}},
{0,t,u,{EdgeForm[],Hue[ (1-Sin[n Pi t] Sin[p Pi u])/2]}},
{t,0,u,{EdgeForm[],Hue[ (1-Sin[m Pi t] Sin[p Pi u])/2]}} },
{t,0,1},{u,0,1},
Lighting->False,PlotPoints->25,AxesLabel->{x,y,z},
ViewPoint->{2.013, 1.731, 1.356},AxesEdge\[Rule]{{-1,1},{-1,1},{-
1,1}},
DisplayFunction->$DisplayFunction];

Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.


0 new messages