Just a few comments/notes below:

> Great... I'll look at using s values instead.  Tried something very
> similar
> actually using my own counter which worked as a percentage.
>
> The other way of doing it I came up with (didn't explain it very well) is
> this.
>
>
> The strands are plotted in StrandsRenderer by passing the centre strand
> alpha carbon (CA) atoms (Point3f[] centers) to  calcScreens(), which
> calculates the CA atoms new, transformed coordinates away from the centre
> starting coordinates (return screens;) .  The transformed CA points
> (screens) are then passed (in segments) to the g3D and onto Hermite.
> Hermite3D.render then plots the hermite curve between the transformed CA
> (p1
> and p2) one pixel at a time ( g3d.plotPixelClipped(a)) , to produce the 5
> strands spread appart evenly either side of the original centre strand/CA
> atoms ie.. 2 strands top 2 strands bottom and one in the middle(centre).
>
> ie.
> _____________________________________________________  strand top5 (5)
> _____________________________________________________  strand top4 (4)
>
>
> CA1      CA2       CA3        CA4       CA5      CA6 .....centre strand
>
> ____________________________________________________  strand  bottom2 (2)
> _____________________________________________________ strand  bottom1 (1)
>
> The ribbons edges would be strands 5 and 1.

Correct

>
> I was thinking that if you just pass the centre strand alpha carbon
> coordinates, capture every 10th pixel that the Hermite3D.render draws
> (g3d.drawClippedPixel(a)) and calculate the equivalent strand 1 and strand
> 5
> coordinate for it using a transform method like that used in Strands
> Renderer for the centre CA atoms.

I agree with almost all of this.

But I don't like the '10th pixel' part. I think you you need to grab the
information at a higher level ... above g3d.drawClippedPixel.

Perhaps it would be helpful for you to think about the problem from a
different perspective.

Let's say that you wanted to cut the ribbon segment into 10 pieces. Don't
worry about the count of pixels.

> SO..
>
> Step 1) pass centre strand CA atoms to hermite
>
>
> CA1 - CA2 - CA3 - CA4
>
>
> Step 2) hermite plots curve and the coordinates for every 10th pixel that
> would be draw by g3d.drawClippedPixel(a), (including first and last) is
> grabbed.
>
>
> CA1 . . . . . . . . . * . . . . . . . . . * . . . . . .CA2  * = grabbed
> pixel coords
>                                                             . = where a
> pixel would normally be drawn
>
>
>
> Step 3) the pixels that are grabbed and stored (just for that segment) are
> then transformed to determine the top strand and bottom strand coordinates
>
>
> top1                top 2               top 3        top 4   (where strand
> 5
> normally run through)
>  |                    |                   |            |
>  |                    |                   |            |
> CA1 . . . . . . . . . *(pix1) . . . . . . *(pix2). . .CA2
>  |                    |                   |            |
>  |                    |                   |            |
> Bottom 1          bottom 2             bottom 3     bottom 4  (where
> strand
> 1 would run)
>
>
>
>
> Then draw triangles between
> top1, bottom 1, top 2
> bottom 2, top 2, bottom 1
> Etc...

OK, this is *very* good.

Here is what I am thinking:

Given two values of s, s[a] & s[b], plus their associated strand1 and
strand5 values:

THRESHOLD = 10 to make it relatively easy to see the triangles
later
THRESHOLD = 3 or 4

if (strand1[a] is less than THRESHOLD pixels from strand1[b] &&
    strand5[a] is less than THRESHOLD pixels from strand5[b])
  plot triangle strand1[b], strand1[a], strand5[a]
  plot triangle strand5[a], strand5[b], strand1[b]
else
  sMid = (s[a] + s[b]) / 2;
  calculate strand1Mid & strand5Mid
  recurse

> This way you get an exactly equal number of coords for the top and bottom
> edges of the ribbon and they would go through twists and turns really
> nicely. The thing I haven't been able to do yet is transform the
> pixels/points that I've grabbed from the centre strand (step 3) out an
> equal
> distance 'above' (top) and 'below' (bottom) the centre point a couple of
> angstroms. (like the strands... spread out from the centre strand).

It is perfectly valid to have all the 2D screen coordinates of strand1 map
to the same spot while strand5 is spiraling around it.

This is why your code needs to work at a higher level. Don't draw a
triangle until both the upper & lower edges are within THRESHOLD pixels.


> What I was going to do was write a method for Hermite3D that gets passed
> the
> coords (Point3i) for a grabbed pixel/point from the centre strand and
> returns the coords for the transformed points (top and bottom ie. Pass it
> CA1 (Point3i), it passes back coords for top1 and bottom 1 in a Point3i
> array - Point3i[] points = new Point3i[2], which I can then use to plot
> triangles.  I was gonna look at the code in StrandsRenderer.calcScreens()
> for how to transform each centre point +/- distance from the original
> centre
> point, to determine the top and bottom coordinates for ribbon edges.

Hmmm ...

I think I see part of the problem you are running into. The Hermite3D code
is all screen based. At that point you do not have the Point3f values to
calculate the ribbon edges strand1 and strand5.

I now think that we need to forget the center strand. Instead, calculate
the screen coordinates of both the upper and lower strands and pass them
in.

Does that makes sense?

Or have I gotten us both confused?

>
> Hope this makes a bit more sense... I'll have a crack at your idea
> tomorrow
> (sounds great... Tried something similar :) , using s will be much better
> though)... I'm gonna take a bit more time out from the lab.  I'm actually
> doing crystallography of a protein for my PhD, can't wait till I get the
> structure and check it out in Jmol... It'll look awesome with ribbons !!
> :)
> (lotsa sheets in it).

Can't wait to see it.

> It's definitely been a pretty steep learning curve... I have the headache
> to prove it :) !

Yup ... it gave me a lot of headaches too.

> Cheers for your help... Definitely 99% perspiration, 1% inspiration for me
> at the moment !

Believe me ... I understand.

You are doing great!


Miguel



-------------------------------------------------------
This SF.Net email is sponsored by: Oracle 10g
Get certified on the hottest thing ever to hit the market... Oracle 10g. 
Take an Oracle 10g class now, and we'll give you the exam FREE. 
http://ads.osdn.com/?ad_id=3149&alloc_id=8166&op=click
_______________________________________________
Jmol-developers mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jmol-developers

Reply via email to