Re: help with cameras
Marc Szymanski <[email protected]> Fri, 8 Jul 2005 16:17:14 +0200
| Newsgroups | gmane.comp.breve |
|---|---|
| Message-ID | <[email protected]> |
Hi Tim,
I would use this code for a camera...
ower :=3D your link
direction :=3D where you want to look relative to the owner's frame=20
5 :=3D jsut a scaling factor
camera look at ((owner get-rotation)*(5*direction) + (owner get-location)=
)=20
from ((owner get-rotation)*(-1*direction)).
for you it would be...
leftCamera look at
((leftEye get-location) + ((leftEye get-rotation) *(0, 0, 1)))
from -((leftEye get-rotation)*(0, 0, 1)).=20
I don't really know if "transform" is the right method to be used... It=20
transforms a world vector in a vector relative to the objects frame... Yo=
u=20
just want to calculate the rotated normal of a surface...
I hope it works...
Best,
Marc.
On Friday, 8. July 2005 15:48, Tim Oates wrote:
> I've implemented a differential drive mobile robot with a pan/tilt ster=
eo
> head in breve/steve. However, I can't quite get the cameras to work
> right. Part of the multibody that is the robot are two links that I
> call leftEye and rightEye. They're attached via fixed joints to
> links that pan and tilt. Associated with each "eye" is a camera that
> should always look in the direction the eye link is facing.
>
> Below is the code I currently have in the iterate method for the pan/ti=
lt
> head that aims the left camera. It gives results that are close to wha=
t I
> want, but they're not quite right.
>
> leftCamera look at
> ((leftEye get-location) + (leftEye transform world-vector (0, 0, =
1)))
> from -(leftEye transform world-vector (0, 0, 1)).
>
> I think the camera starts out pointing in the (0, 0, 1) direction. I'm
> sure the hard-wired (0, 0, 1) needs to be replaced with a vector obtain=
ed
> dynamically at the start of the simulation that's normal to the "front"
> surface of the leftEye link.
>
> Does anyone out there know the right way to keep a camera pointed in a
> direction normal to a given surface of a link?
>
> - tim
>
>
> ---------------------------------------
> Tim Oates, Assistant Professor
> Department of CS and EE
> University of Maryland Baltimore County
> (410) 455-3082
> http://www.cs.umbc.edu/~oates
>
>
> _______________________________________________
> breve mailing list
> [email protected]
> http://lists.spiderland.org/mailman/listinfo/breve
--=20
-------------------------------------------------------------------------=
-
Dipl.-Inform. Marc Szymanski
Institute for Process Control and Robotics(IPR), Universit=E4t Karlsruhe(=
TH)
Kaiserstr. 12, D-76128 Karlsruhe, Germany
Phone: +49 721 608 6694, Fax: +49 721 608 7141
WWW http://wwwipr.ira.uka.de/~szymansk
_______________________________________________
breve mailing list
[email protected]
http://lists.spiderland.org/mailman/listinfo/breve