Dear Vaclav, Thank you very much for your detailed reply. It's really very helpful.
Cheers, Tao 2010/12/7 Václav Šmilauer <[email protected]> > > What's more, I also want to know how to zoom the view automatically by >>> adding some codes in GLViewer.cpp file? For instance, I want my model always >>> be shown in the same size as the view. >>> >> Hi Tao, there is a functionality to save & load the 3d view configuration >> (using the keys Alt-7,8,9 and 7,8,9 to save/load, and Alt-S to save to file >> I think), and one can also handle that from scripts. They key is to >> understand that the GL rendering happens in 2 places, one is >> qt.OpenGLRenderer, the other one is qt.GLViewer (which you can retrive by >> calling qt.views()[0] IIRC). I will write you a proper answer tomorrow, you >> can have a look in docs for now. >> > Hi Tao, sorry for late reply. I fixed the docs so that the python interface > to the glviewer is properly documented now ( > https://www.yade-dem.org/sphinx/yade.qt.html ; note that the > yade.qt._GLViewer is itself imported directly to yade.qt, so you never have > to specify _GLViewer). You can save views with Alt+7,8,9 and load it by > pressing 7,8,9 again (press "h" in the view to get some terse help on that); > those 3 states are saved in scene and can be saved/loaded programatically > via loadState(num)/saveState(num). The viewer object can be obtained either > when you create it with v=qt.View(), or when already opened, with > v=qt.views()[0]. > > Then use v.loadState(1), v.saveState(2) etc. Individual parameters can be > also manipulated, see > https://www.yade-dem.org/sphinx/yade.qt.html#yade.qt._GLViewer.GLViewer , > also get some inspiration in scripts/test/beam-l3geom.py where the view is > set "by hand". > > The GLViewer determines how do you look the scene, whereas OpenGLRenderer > determines what is actually drawn in the 3d space (whether you see > particles, or interactions etc); for that, see > https://www.yade-dem.org/sphinx/yade.wrapper.html#yade.wrapper.OpenGLRenderer, > which is also accessible from the second tab of the Controller (In there, > you also have access to all Gl1_* functors and their attributes). You can > get the renderer (there is only one instance of it) from qt.Renderer() and > then play with that. > > Hope this help a bit. > > Cheers, v. > > > > > _______________________________________________ > Mailing list: > https://launchpad.net/~yade-users<https://launchpad.net/%7Eyade-users> > Post to : [email protected] > Unsubscribe : > https://launchpad.net/~yade-users<https://launchpad.net/%7Eyade-users> > More help : https://help.launchpad.net/ListHelp > > -- Tao Zhao DPhil student in Engineering Science Department of Engineering Science, Parks Road, Oxford, OX1 3PJ University of Oxford, United Kingdom Tel: (0044) 01865283268 (office) Mobile: (0044) 07587493495 E-mail: [email protected] OR [email protected] <[email protected]>
_______________________________________________ Mailing list: https://launchpad.net/~yade-users Post to : [email protected] Unsubscribe : https://launchpad.net/~yade-users More help : https://help.launchpad.net/ListHelp

