width, height | Širina in višina platna v pikslih. Privzeti vrednosti sta 640 in 400. Določimo ju pri tvorbi platen, kasneje pa ju lahko spreminjamo. |
align |
Platno lahko prisilimo na levo (left) ali desno (right) okna, privzeto je "none". |
resizable | Če je True (privzeto) lako uporabnik spreminja velikost platna. Če imamo na primer platn C in funkcijo R, bi ukaz C.bind('resize', R) pri vsaki spremembi platna klical to funkcijo. |
background | Nastavi barvo , s katero se zapolni ozadje platna. Privzeta vrednost je "black" (črna). |
ambient | Barva neusmerjene osvetlitve scene (takoimenovani "ambient") Privzeta ambienna osvetlitrv je siva: color.gray(0.2). |
lights |
Seznam svetil za dano sceno. Privzeti seznam teh luči je:
[distant_light(direction=vec( 0.22, 0.44, 0.88), color=color.gray(0.8)), distant_light(direction=vec(-0.88, -0.22, -0.44), color=color.gray(0.3))] Spremembo barve prve luči v tem seznamu lahko naredimo na primer tako:
scene.lights[0].color = color.red
|
objects | To je seznam objetov, ki so vidni na platnu; Nevidnih objektov
ni v tem seznamu. Naslednji primer kaže, kako bi vse, na scenui vidne objekte pobarvali rdeče:for obj in scene2.objects: |
visible | Če nastavimo scene.visible = False, ne bi bil noben objekt na sceni viden, dokler ne napišemo ukaza scene.visible = True. |
delete() | To ni lastnost. Je metoda, ki zbriše vse objekte na platnu in zatem še platno samo |
scene.camera.follow() Privzeto kaže kamera vedno v središče
scene, vendar lahko smer pogleda spremenimo in namesto tega gledamo
stalno v nek objekt. Primer;
scene.camera.follow(ball)
Center scene (torej naš pogled) bo stalno resetiran na položaj krogle.Sledenje žogi zaustavimo s stavkom
scene.camera.follow(None).
scene.title = "To je naslov nad platnom"
scene.caption = "To je podnaslov pod platnom"
Podnaslov je lahko dolg več vrstic, pri čemer za konec vrstice uporabljamo "\n"
|
scene.camera.pos The current location of the camera, whether due to your own settings, autoscaling, or as positioned by the user, is scene.camera.pos. For example, mag(scene.center - scene.camera.pos) is the distance from the current position of the camera to the center of the scene. The vectors scene.camera.pos and scene.mouse.ray together define all of the 3D points under the mouse cursor. You can place the camera where you want it by executing scene.camera.pos = vector(x,y,z). When you set the camera position in this way, scene.center is reset to the location scene.camera.pos + scene.camera.axis. The effect is that the camera continues to point in the same direction as before, but from a new location. scene.camera.axis The
current direction that the camera is pointing, whether due to your own
settings, autoscaling, or as positioned by the user, is scene.camera.axis, which is equal to scene.center - scene.camera.pos; it points from the camera to scene.center. scene.up Changing scene.up rotates the display around the z axis and would be appropriate for example if you imagine the camera is attached to an airplane that rotates around its own axis in a turn or barrel roll. scene.camera.rotate(angle=..., axis=..., origin=...) As with other VPython objects, you can rotate the camera by an angle in radians, about a specified axis (which by default is scene.camera.axis), relative to a specified origin (which by default is scene.camera.pos). |