POV-Ray : Newsgroups : povray.newusers : Rotating Server Time
4 Nov 2024 17:33:25 EST (-0500)
  Rotating (Message 1 to 4 of 4)  
From: Bryan Heit
Subject: Rotating
Date: 9 Dec 2004 18:14:36
Message: <41b8dc5c$1@news.povray.org>
I have an unusual and long question about rotating.  I'm working on 
making some 3D models of some proteins for work.  Some of these proteins 
have portions which move relative to other parts of the protein.  I want 
to be able to move these parts relative to each other.  At this point I 
am achieving this by drawing each "half" of the protein as a separate 
object, rotating/translating the moving part, and then "unioning" them 
together.


The problem with this process is that when I rotate the objects rotate 
around their centres, rather then around the point where they join.  At 
this point this isn't a huge problem, but in the future I am planning on 
animating these things, and it would be quite difficult to do so using 
the current model.  What I was wondering is if there was a way to set-up 
an object such that the "centre of rotation" was at a specified place, 
rather then where the computer assigns it.

Thanx

Bryan


Post a reply to this message

From: Warp
Subject: Re: Rotating
Date: 9 Dec 2004 19:14:31
Message: <41b8ea67@news.povray.org>
Bryan Heit <bjh### [at] nospamucalgaryca> wrote:
>  What I was wondering is if there was a way to set-up 
> an object such that the "centre of rotation" was at a specified place, 
> rather then where the computer assigns it.

translate -CenterOfRotation
rotate Whatever
translate CenterOfRotation

-- 
#macro N(D)#if(D>99)cylinder{M()#local D=div(D,104);M().5,2pigment{rgb M()}}
N(D)#end#end#macro M()<mod(D,13)-6mod(div(D,13)8)-3,10>#end blob{
N(11117333955)N(4254934330)N(3900569407)N(7382340)N(3358)N(970)}//  - Warp -


Post a reply to this message

From: Mike Raiford
Subject: Re: Rotating
Date: 10 Dec 2004 08:07:28
Message: <41b99f90$1@news.povray.org>
Bryan Heit wrote:
> I have an unusual and long question about rotating.  I'm working on 
> making some 3D models of some proteins for work.  Some of these proteins 
> have portions which move relative to other parts of the protein.  I want 
> to be able to move these parts relative to each other.  At this point I 
> am achieving this by drawing each "half" of the protein as a separate 
> object, rotating/translating the moving part, and then "unioning" them 
> together.
> 
> 
> The problem with this process is that when I rotate the objects rotate 
> around their centres, rather then around the point where they join.  At 
> this point this isn't a huge problem, but in the future I am planning on 
> animating these things, and it would be quite difficult to do so using 
> the current model.  What I was wondering is if there was a way to set-up 
> an object such that the "centre of rotation" was at a specified place, 
> rather then where the computer assigns it.
> 
> Thanx
> 
> Bryan
> 
There are macros in the transforms.inc file that allow this kind of stuff

Rotate_Around_Trans(Rotation, Point) seems like it would do what you want.

-------------------------------------------------------------------
The following may help, but I make no guarantees. From here on out 
consider what I'm saying as simply rambling.
-------------------------------------------------------------------

Generally if I want to "articulate" something, I build the end that will 
be doing the rotation at the origin, pass its rotations into a macro 
that creates the object with an articulation point, then translate it to 
where it is. When modelling in POVRay, I tend to use very localised 
coordinate systems.

An example of what I mean by localised coordinate systems.

Suppose I wanted a table that sat on a floor with a glass on the table:

1) Define the glass so its bottom is at the origin.
2) Define the table so its top is at origin.

3) Define a union of the table and the glass. Translate so the feet are 
at origin

4) Define the floor so it is at origin.

There are a few caveats:

1)  I assume its easy to see how far you need to translate the 
table-glass union. The legs of the table end at a specifc -Y value (RHCS)

2) I did not mention that the translation of the glass should be down by 
a very very tiny amount (or up, depending on how many surfaces you want 
to be considered by IOR at the bottom of the glass)

3) It may be too difficult to know where to start/end on a protien 
structure, which I'm making a wild guess that it is not entirely 
hand-modelled, but coming from a molecular-level modelling program?

-- 
~Mike


Post a reply to this message

From: Bryan Heit
Subject: Re: Rotating
Date: 10 Dec 2004 09:32:36
Message: <41b9b384$1@news.povray.org>
Mike Raiford wrote:
<snip>>
> There are macros in the transforms.inc file that allow this kind of stuff
> 
> Rotate_Around_Trans(Rotation, Point) seems like it would do what you want.

I'll have to check that out, it sounds exactly like what I need.

<snip>


> 3) It may be too difficult to know where to start/end on a protien 
> structure, which I'm making a wild guess that it is not entirely 
> hand-modelled, but coming from a molecular-level modelling program?

My models come from a variety of sources, and exactly what they look 
like depends on what I am trying to show.  Some are exact models of the 
protein crystalline structure - these I import directly from protein 
modelling programs, using a utility I picked up off the net (protein 
models are essentially a series of interconnected spheres, so they're 
perfect for POV-Ray).  These I rarely want to animate, as the complex 
structures just make things confusing for the audience.  The other type 
of model I use are "idealized" models, where I make a shape which 
approximates the 3D shape of the protein in POV-ray.  These are the ones 
I usually want to "bend" as these models are used to demonstrate changes 
in protein structure.

Thanx for the idea's

Bryan


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.