|
From: <pri...@gm...> - 2007-06-15 18:52:16
|
hi folks, I am new to VPython so this question may sound a little bit naive; I've got a question concerning the problem how to visiualize a 2D-manifold in Vypthon. In this special case, the parameters are Theta and Phi to just plot a part of the surface of a sphere, where the Radius is constant. An additional feature would be that the surface is something like transparent or it also could be a spherical grid. I hope my english is not too bad, so that some of you could understand what my problem currently is. I hope I'll receive any help soon. Thank you very much. greets from germany -Philipp > You might study the example program faces_heightfield.py that comes with > VPython, as it creates a surface. > > The most general VPython object is "faces" which lets you display > arbitrary triangles and specify lighting at vertices. This low-level > object could be used to display a portion of a sphere. Or if you want to > display a portion of a sphere as a grid, use the "curve" object. > > There exists a beta version of VPython which lets you specify that an > object is transparent. See the "Recent developments" section of > vpython.org. Unfortunately the Windows version has some serious bugs > (see the documentation in the Recent developments section) and there is > no Macintosh version. The Linux version mostly works correctly. > > Bruce Sherwood > > pri...@gm... wrote: > > hi folks, > > > > I am new to VPython so this question may sound a little bit naive; > > I've got a question concerning the problem how to visiualize a > 2D-manifold in Vypthon. In this special case, the parameters are Theta and Phi to > just plot a part of the surface of a sphere, where the Radius is constant. An > additional feature would be that the surface is something like transparent > or it also could be a spherical grid. I hope my english is not too bad, so > that some of you could understand what my problem currently is. I hope > I'll receive any help soon. > > > > Thank you very much. > > > > greets from germany > > > > -Philipp > > thx for the fast post. just like you recommanded, i have studied this example, and also tried to plot my surface. but this heightfiled_faces.py example comes a little bit complicated and it also doesn't do that what I expected. i need to add that I am new to python and I just wonder that it doesn't seem to be easy to plot a 3D-surface (just like in mathematica for example). nevertheless, I would truly like to understand this example programm, and also what I made wrong in useage; here are the differences to the example prog: ############################ theta = arange(0,pi/2.0,2./20) phi= arange(0,2.0*pi,2./20) x = sin(theta)*cos(phi) y = sin(theta)*sin(phi) m = Mesh( x, sqrt(1.0 - (x**2.0 + y**2.0)), y) ############################ when I try to run faces_heightfield.py with these modifications, "frames are not aligned" occurs. maybe somebody could help me with this problem, I would truly appreciate it....Thank you very much. -phil -- Psssst! Schon vom neuen GMX MultiMessenger gehört? Der kanns mit allen: http://www.gmx.net/de/go/multimessenger |