Hi Alastair,

50-100k triangles comes down to 600-1200k floats that have to be
stored in memory. That's heavy stuff! Of course there's quite a bit of
redundancy, since many points arepart of several triangles, but I
don't think that this is considered for CGO.
There is a way though to get the triangulated VdW surface, colored by
atoms. It's the default of 'surface'. Added benefit of that is that I
think it does have an optimized mesh representation internally. Of
course there must be a specific reason why you want to have your own
triangles... Maybe POV-Ray is the way to go then. It does allow
optimized meshes and can deal with really huge ones. Oh, and it comes
natively with easily adjustable transparency ;)

Cheers,

Tsjerk

On Mon, Apr 19, 2010 at 10:22 PM, Alastair Fyfe <af...@soe.ucsc.edu> wrote:
> Hi Tsjerk,
> many thanks - I had missed the "ALPHA, 1.0" and was only specifying RGB
> values. The surfaces I've been working with have 50-100K triangles, which is
> why I was wondering whether there was a more direct binary interface. Still
> everything works, and with the addition of that alpha setting I should be
> able to control transparency.
>
> It is puzzling though that there's not a ready way to generate a VDW surface
> colored by atom name.  It's doable by checking each triangle for its
> adjacent atom and coloring accordingly, but this seems such a common task
> I'm surprised there's not already code available for it.
> Best,
> Alastair
>
> Tsjerk Wassenaar wrote:
>>
>> Hi Alastair,
>>
>> The CGO file should come out something like:
>>
>> cgo_obj = [
>>  BEGIN, TRIANGLES, ALPHA, 1.0,
>>  COLOR, 1.0, 1.0, 1.0,
>>  NORMAL,   -1.70693,  -11.93375,   23.78227,
>>  VERTEX,   39.96822,   39.96822,  -36.33474,
>>  VERTEX,   34.37814,   37.81595,  -37.81595,
>>  VERTEX,   38.78347,   35.25770,  -38.78347,
>>  COLOR, 1.0, 1.0, 1.0,
>>  NORMAL,   -8.49790,   -9.67383,  -13.55758,
>>  VERTEX,   36.09036,   36.09036,   32.80942,
>>  VERTEX,   35.67732,   32.43392,   35.67732,
>>  VERTEX,   32.32192,   35.55411,   35.55411,
>>  ...
>> ]
>>
>> and then you can do cmd.load_cgo(...), but that I guess you already
>> know. Right after the TRIANGLES directive, you can notice the ALPHA
>> directive, followed by the value for the alpha channel. In this
>> example it's set to 1.0, so it's completely opaque; lowering it will
>> make it transparent. I have a simple C program somewhere to convert a
>> set of triangles specified as vertices and indices into a cgo
>> representation. If you're interested I can send you that. I've been
>> able to work with quite large triangulated surfaces with this (4096
>> triangles, and I think even up to 16384, but that was too slow to work
>> with).
>>
>> Hope it helps,
>>
>> Tsjerk
>>
>>
>> On Mon, Apr 19, 2010 at 7:09 PM, Alastair Fyfe <af...@soe.ucsc.edu> wrote:
>>
>>>
>>> Hi,
>>> I'm using cgos of fairly large triangulated surfaces from other programs
>>> and was wondering if anyone had guidance regarding the following:
>>> - the cgo encoding of individual triangles is somewhat bulky and makes
>>> for huge files which are slow for pymol to load. Is there an
>>> alternative, more efficient means of cgo input?
>>> - set cgo-transparency() does not seem to behave as expected, the
>>> surface remains opaque. Is there a way to specify alpha along with RGB
>>> for individual triangles or any way to investigate why cgo-transparency
>>> might not be working?
>>> - is there a way to have obtain a VDW surface colored by atom name (eg
>>> N3,N7 etc., not atom type)?
>>> thanks!
>>> Alastair
>>>
>>>
>>> ------------------------------------------------------------------------------
>>> Download Intel&#174; Parallel Studio Eval
>>> Try the new software tools for yourself. Speed compiling, find bugs
>>> proactively, and fine-tune applications for parallel performance.
>>> See why Intel Parallel Studio got high marks during beta.
>>> http://p.sf.net/sfu/intel-sw-dev
>>> _______________________________________________
>>> PyMOL-users mailing list (PyMOL-users@lists.sourceforge.net)
>>> Info Page: https://lists.sourceforge.net/lists/listinfo/pymol-users
>>> Archives: http://www.mail-archive.com/pymol-users@lists.sourceforge.net
>>>
>>>
>>
>>
>>
>>
>
>



-- 
Tsjerk A. Wassenaar, Ph.D.

post-doctoral researcher
Molecular Dynamics Group
Groningen Institute for Biomolecular Research and Biotechnology
University of Groningen
The Netherlands

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
PyMOL-users mailing list (PyMOL-users@lists.sourceforge.net)
Info Page: https://lists.sourceforge.net/lists/listinfo/pymol-users
Archives: http://www.mail-archive.com/pymol-users@lists.sourceforge.net

Reply via email to