![](/i/fill.gif) |
![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
John VanSickle wrote:
> David Fontaine wrote:
> >
> > John's macro should do what you want. The only problem I think would be the axial
> > rotation changing, but if your gun stays pointing on the x-z plane with y up it
> > shouldn't matter I think. I've written one aimilar to keep axial rotation the same
> > (perpendicular vector intersecting y axis still intersects y axis). It's a lot
> > messier than John's though.
>
> The Reorient vector tilts as if the joint were a ball-and-socket joint. If you
> want to tilt in the way the POV camera tilts when the look_at parameter is
> specified, here is some tighter, neater, and more flexible code.
Ah, now I get it. The 'up' parameter is a good idea too.
--
David Fontaine <dav### [at] faricy net> ICQ 55354965
Please visit my website: http://davidf.faricy.net/
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Tor Olav Kristensen wrote:
>
> BUT: From what I can see you're calculating the same things several times.
>
> Wouldn't it be better to store calculated values in variables and use them
> up again when needed ?
>
> (Or is there too much overhead for POV to make these new variables ?)
>
Oh, certainly the method I suggested isn't optimized. I'm just lazy, and since
the v_parallel macro was so conveniently lying around, I probably saved a whole
10 keystrokes :)
--
Margus Ramst
Personal e-mail: mar### [at] peak edu ee
TAG (Team Assistance Group) e-mail: mar### [at] tag povray org
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Paul Jones wrote:
>
> Does this assume that your object is not located somewhere else other
> than the origin? (<0,0,0>)
On the contrary, it assumes that the object is at the origin.
> What if I have a gun turret that is located at <5,0,5> (ie: it
> rotates around the line defined by <5,y,5>), would this macro take
> that in to account? or would another parameter _location_ be required?
Actually, it would be easier to model it at the origin, turn it using
the macro, and then translate it to where you want it.
But if you've already modeled it to turn around some other point, then
use some other transforms before and after:
object { MyGun
translate -GunLocation
PointAlong(z,<-1,1,14>,y)
translate GunLocation
}
This moves the object to the origin, rotates it, and then moves it back.
This code assumes the gun is originally modelled pointing in the +z
direction.
BTW, the macro I gave earlier turns the object, and raises it or lowers
it as well (ie, give both yaw and pitch). If you want just yaw or just
pitch, let me know and I'll explain how to call the macro for that.
Regards,
John
--
ICQ: 46085459
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
John VanSickle wrote:
> BTW, the macro I gave earlier turns the object, and raises it or lowers
> it as well (ie, give both yaw and pitch). If you want just yaw or just
> pitch, let me know and I'll explain how to call the macro for that.
How is this a special case?
--
David Fontaine <dav### [at] faricy net> ICQ 55354965
My raytracing gallery: http://davidf.faricy.net/
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
David Fontaine wrote:
>
> John VanSickle wrote:
>
> > BTW, the macro I gave earlier turns the object, and raises it or lowers
> > it as well (ie, give both yaw and pitch). If you want just yaw or just
> > pitch, let me know and I'll explain how to call the macro for that.
>
> How is this a special case?
It's not a special case, but rather a change in what the user wants (since
that's what I was asking for: to know if there was a change in what he
wanted).
Anyway, suppose one has a gun turret (the example under discussion), like
the top of a tank, for instance. The gun both turns and lifts, while the
turret just turns. The macro I supplied here will give the transform for
the gun, but not the turret; however, if the NewDirection vector is
modified so that vdot(NewDirection,Up)=0, the macro will give the transform
for the turret. It would be used this way:
#local TurretDir=NewDirection-Up*vdot(NewDirection,Up);
PointAlong(OldDirection,TurretDir,Up)
The user needs to identify which objects need freedom of movement in
both directions, which need freedom of movement in one direction, and
group and align them as follows:
union { // gun and turret
union { // just the gun
object { GunPart1 }
object { GunPart2 }
PointAlong(ModelDirection,NewDirection,Up)
} // end of just the gun
union { // just the turret
object { TurretPart1 }
object { TurretPart2 }
PointAlong(ModelDirection,TurretDirection,Up)
} // end of just the turret
translate GunTurretLocation
} // end of gun and turret
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
John VanSickle wrote:
> It's not a special case, but rather a change in what the user wants (since
> that's what I was asking for: to know if there was a change in what he
> wanted).
>
> Anyway, suppose one has a gun turret (the example under discussion), like
> the top of a tank, for instance. The gun both turns and lifts, while the
> turret just turns. The macro I supplied here will give the transform for
> the gun, but not the turret; however, if the NewDirection vector is
> modified so that vdot(NewDirection,Up)=0, the macro will give the transform
> for the turret. It would be used this way:
>
> #local TurretDir=NewDirection-Up*vdot(NewDirection,Up);
> PointAlong(OldDirection,TurretDir,Up)
>
> The user needs to identify which objects need freedom of movement in
> both directions, which need freedom of movement in one direction, and
> group and align them as follows:
[snip]
It's still just a simple task for the user to do that with the standard
macro... but I see now that's what you were going to tell him how to do. :)
--
David Fontaine <dav### [at] faricy net> ICQ 55354965
My raytracing gallery: http://davidf.faricy.net/
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |