| |
 |  |  |  | Command |  | Argument |
 | Datatype |  | Default |  | Min |  | Max |  |
 |  | Format: |  | ShowSphere | |
Radius = Sphere radius, |  | FLOAT |  |
- |  | - |  | - |  |  | |  |
| | Color = Sphere color, |  | RGBCOLOR |  |
- |  | - |  | - |  |  | |  |
| | Alpha = Alpha blending factor, |  | FLOAT |  | 100.0 |  |
0.0 |  | 100.0 |  |  | |  | | | Level = Tesselation level, |
 | INT |  | 1 |  | - |
 | - |
 |  | |  |
| | ScaleY = Scaling factor along Y-axis, |
 | FLOAT |  | 1.0 |  | - |
 | - |
 |  | |  |
| | ScaleZ = Scaling factor along Z-axis |
 | FLOAT |  | 1.0 |  | - |
 | - |
 |  |  | Python: |  | result = ShowSphere(radius,color,alpha=None,level=None,scaley=None,scalez=None) |
 |  |  | Menu: |  | Effects > Show solid > Sphere & ellipsoid |  |
 |  | Related: |  | ShowBox, ShowCone
, ShowTorus, MoveMesh
|  |  |
 | Required: |  |  |  |
 |
The ShowSphere
command creates a sphere object consisting of triangles. The
Color and Alpha parameters set the sphere's color and transparency. The tesselation
Level parameter defines how many triangles are used to approximate the sphere. The
parameters ScaleY and ScaleZ can be used to stretch the sphere along the Y and Z-axis to create an ellipsoid.
The created sphere rotates around the origin of its local coordinate system
, which is at the center of the sphere. Use the MoveMesh
command to shift the origin.
Example 1:
ShowSphere Radius=10,Color=Red
Show a red sphere with 10 A radius.
Example 2:
ShowSphere Radius=10,Color=Red,Alpha=50%
As above, but half transparent.
Example 3:
ShowSphere Radius=10,Color=Blue,ScaleY=3
Show a blue ellipsoid with 10 A width and 30 A height.
Example 4:
obj = ShowSphere 50,Blue,Level=0
Show a blue sphere with 50 A radius that consists of a minimum number of triangles and assign the object number to variable
'obj'.
Example macro:
# EXAMPLE ShowSphere
# Requires YASARA Model
Clear
Style Ribbon
# Create a sphere
r=50
ShowSphere Radius=(r),Color=ff8000,Level=2
# Build an alpha helix
phi = -50
psi = -50
# Start with the first residue
helix = BuildRes Ala,(psi)
OriObj (helix),355,326,0
Move Z=200
# Extend the helix
for i=2 to 50
AddRes Ala,(helix),Phi=(phi),Psi=(psi)
# Attach n helical 'spikes' to the sphere
n=50
while Objects<n+1
# Duplicate a helix
obj = DuplicateObj (helix)
# Choose a random orientation
beta = rnd 360
gamma = rnd 360
RotateObj (obj),0,(beta),(gamma)
# And move to the surface of the sphere
x = r*cos beta
z =-r*sin beta
y = x*sin gamma
x = x*cos gamma
MoveObj (obj),(x),(y),(z)
# If it bumps into the others, delete again
if obj>3
DelObj (obj) Atom CA with distance<10 from 3-(obj-1) Atom CA
DelObj (helix)
AutoRotate Y=0.2
 | | Figure: Result of the example macro above. |
|