[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[help-3dldf] Reflections
From: |
Laurence Finston |
Subject: |
[help-3dldf] Reflections |
Date: |
Sat, 18 Dec 2004 00:24:13 +0100 |
User-agent: |
IMHO/0.98.3+G (Webmail for Roxen) |
From: "Martijn van Manen" <address@hidden>
I hope it's okay with you that I'm posting this to the mailing list.
> I'm doing my best
> to figure out the polyhedrons and the stellations and the
> facetting, and so on, and so forth...
Thanks for the attachments; I only noticed them just now.
I got Coxeter's _Regular Polytopes_ and _Regular Complex Polytopes_ out of the
library and took a look at them. The first one isn't too difficult, so I may
try to work through it in the future. At the moment, I'm working on Jaenich's
_Lineare Algebra_. The second book has some beautiful pictures in it.
> beginfig(1);
> Point center(0, 0, 0);
> Rectangle r(center, 1, 1);
I never use 3DLDF like this anymore. I only ever use the
3DLDF language.
// draw the XZ plane
// I would like to be able to project onto a plane
// and to reflect through a plane
I've implemented functions and parser rules for reflecting objects in planes.
They seem to work, although I want to change a few things which are not
visible to users. Perhaps you could try them out when you get a chance. I
think there might well be a better way of implementing them.
I've also implemented functions and rules for reflecting objects off of
planes, but I'm not happy with them. They seem to work correctly, but I think
my idea was wrong.
// Maybe we can have a rectangle, that induces a transform
// and then apply the transform to the point?
I don't understand this. Does a rectangle somehow imply a particular
transformation?
// So I'd like something like
// Transform T1(r);
// Point p(0,0,1);
// p.transform(T);
// Or a variant...
for(int i=1;i<9;i++) { r.set(center,i,i); r.draw(); }
Point pos(2, 3, 4);
Point dir(2, 1, -2);
// If I choose the wrong focus I can get a numerical overflow
// in MetaPost. Ie. I get a message saying my feet's too big:
// numeric overflow, should I not be protected against that?
Maybe. I don't think it would be difficult, but it's a matter of getting
around to it. Before I do this, I'll look into trying to make it possible for
MetaPost to draw bigger pictures. It might be a single value that needs to be
increased.
Focus f(pos, dir, 4);
Point pt0(1,3,3);
Path Q0(¢er,"--",&pt0,0);
Q0.draw();
// now project pt0 onto the rectangle
Point pt1(1,0,3);
Path Q1(&pt0,"--",&pt1,0);
Q1.draw();
Point dir0(0,-6,0);
Line L0(pt0,dir0);
// why can't I get an endpoint of the line ?
Because `Lines' don't have endpoints. They only have a `position' and a
`direction' and are used for vector calculations.
If you want a linear `Path', you can just say `Path p(q, r);'.
Path Q2=L0.get_path();
Q2.draw();
Point pt2=pt0+dir0;
Point pt3(-1,3,-3);
Path Q3(&pt2,"..",&pt3,0);
Q3.draw();
pt3.label("Reflection of $P$","rt");
pt2.label("Virtual image of $P$","rt");
pt1.label("Projection of $P$","rt");
pt0.label("$P$","rt");
center.dotlabel("$O$","lft");
current_picture.output(f);
endfig();
This is the first time I've seen 3DLDF code that I haven't written!
Laurence
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [help-3dldf] Reflections,
Laurence Finston <=