From: Chris L. <chr...@sp...> - 2006-12-14 21:48:39
|
I'm trying to rotate the camera around an object: from visual import * scene.background = (.6,.6,.6) from visual import frame, cylinder groundframe = frame() g = cylinder(frame = groundframe, radius =10 , red = 0, blue = 0, axis = (0,0,-.1),opacity= .2) from visual import frame, arrow, label opacity = 0.1 shaftwidth = .005 axisframe = frame() labelframe = frame() xeaxis = arrow(frame = axisframe, shaftwidth = shaftwidth, axis=(10,0,0), color =(1,0,0),opacity = opacity) # xe red xwaxis = arrow(frame = axisframe, shaftwidth = shaftwidth, axis=(-10,0,0), color =(0,1,1),opacity = opacity) # xw cyan ynaxis = arrow(frame = axisframe, shaftwidth = shaftwidth, axis=(0,10,0), color =(0,1,0),opacity = opacity) # yn green ysaxis = arrow(frame = axisframe, shaftwidth = shaftwidth, axis=(0,-10,0), color =(1,0,1),opacity = opacity) # ys magenta zpaxis = arrow(frame = axisframe, axis=(0,0,1), color =(0,0,1),opacity = opacity) # zp blue zmaxis =arrow(frame = axisframe, axis=(0,0,-1), color =(1,1,0),opacity = opacity) # zm yellow nlabel = label(frame = labelframe, pos = ynaxis.axis, text = 'N',opacity = opacity) elabel = label(frame = labelframe, pos = xeaxis.axis, text = 'E',opacity = opacity) wlabel = label(frame = labelframe, pos = xwaxis.axis, text = 'W',opacity = opacity) slabel = label(frame = labelframe, pos = ysaxis.axis, text = 'S',opacity = opacity) scene.forward = (0,.7,-.6) Gives me a view over the south axis towards the centre of the frame. I want to rotate the camera so I can look over the E W and North axis but maintain the overall 'display' If I had a box drawn at 0,0,0 I would like to look at the four vertical faces inturn. by using the rotate command. I am trying to use rotate to enact 3 buttons which act out the following three commands. scene.forward = rotate( scene.forward, axis = (0,0,-1), angle = pi/2 ) scene.forward = rotate( scene.forward, axis = (0,0,-1), angle = pi ) scene.forward = rotate( scene.forward, axis = (0,0,-1), angle = (3 *pi)/2 ) i reckon I'm not really understanding up's effect on all this but i've got to the randomly poking in numbers which isn't having much useful effect. I am trying to build an environment that i can rotate easily in 90 degree chunks at the press of a command button but maintain the overall 'appearance'. In essence so I view the scene from a similar elevation above the groundplane bu the position rotated appropriately round the centre point. -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.409 / Virus Database: 268.15.18/584 - Release Date: 12/12/2006 |