From: David S. <dsc...@cm...> - 2000-11-15 14:47:36
|
> Thanks for your answer. I am definitly no physics professor and > I'm willing to learn from everyone. I was teasing Bruce, who definitely is a physics professor, and who answered your question by essentially restating what you said. > In terms of just camera and object what I said is indeed the > same. but with lighting it looks different. Either you are "rotating the scene" and the lights rotate with the scene because they are part of it, or you are "moving the camera" while the scene and lights stay still. I agree that in this case the "moving camera" interpretation is more natural, but I'm not confident that everyone else will agree. > And for fidling with molecules and editing their geometry in 3d I > think it is much more convenient "human-brain-wise" to turn the > *object*. Fair enough. > ah! ok. so I will have to sit down, take the red bible on openGL > and figure out > how to position the lighting where the camera is. i'll try my very best. The code you want to modify is in gldevice.cpp. Look for a line beginning rView view(wct, display->lights, Here you can change the lighting to do whatever you want. I think this might do what you desire: lighting new_lights; // Ambient light 0.2 (this is the normal default) new_lights.ambient = 0.2; // Light in the direction of the camera, maximum brightness: new_lights.L[0] = (cam - display->c_center).norm() * 1.0; // This light is off: new_lights.L[1] = Vector( 0, 0, 0 ); // Use new_lights instead of display->lights rView view(wct, new_lights, ... > oh you are right ... as I said, just a chemist. apologies. > my wavefunktions or elecron densities are 3D scalar fields on a > structured grid > (even spaced cartesian) and what I meant was to generate a > iso-surface (polygon > mesh?) from that either directly in VPython or outside and hand > it to VPython as > a NumPy array. Okay, understood. If you want the isosurface to be transparent, your best bet for the moment might just be to draw the grid with curves: isosurface = calc_isosurface(...) # isosurface[i,j] = [x y z] position for i in range(isosurface.shape[0]): curve(pos = isosurface[i,:]) for j in range(isosurface.shape[1]): curve(pos = isosurface[:,j]) Dave |