|
![](/i/fill.gif) |
John,
I've found your page and the description is helping me to understand.
1) I don't know if I'll ever need a zoom of 0.1. But I generally used a zoom
of 1.0 and I see the effect. I will work to understand the cause and find a
fix.
2) Acknowledged. I'm guessing that one of the vcross results is a zero
length vector and that is the cause of the error. I'll through some checks
in before the matrix operation.
3) I was trying to scale the text to zero thickness, but it seems that a
zero scale factor is interpretted as one. When I set the text thickness to
zero, it worked perfectly.
4) I totally agree that the text should be manipulated and not the camera. I
just hadn't figured out how. With a little experimentation, it seems that
pushing the text back in the +z direction before matrix'ing it does the
trick. It also makes sense in that the matrix'ed text will be pushed back
along the line of sight. Your example actually did this by placing the
sphere at z position CamZoom.
4b) Is there a way to determine the length in units of a text object?
Something like textObject.length?
4c) Is there a way to determine the height or depth of a text object or any
object in general?
4d) Is there a way to extract parameters from the current camera, without
"passing" them in as "#local"s. Something like cameraObject.look_at.x?
Thanks and regards,
Bill
"John VanSickle" <van### [at] erols com> wrote in message
news:39D7F83F.E2013A94@erols.com...
> Bill Brehm wrote:
> >
> > Thanks John. I've been experimenting with this and have noticed some
> > "problems". I don't quite have a full picture of what the matrix
> > command is doing, so I haven't been able to solve these problems on my
> > own.
>
> I maintain a page that explains what the matrix transform does.
>
> The matrix in the example code moves objects so that they are in front
> of the camera.
>
> > 1) With a CamZoom of 2.5, I see no distortion in the sphere. At CamZoom
= 1,
> > I can see the sphere beginning to distort. With low CamZooms of 0.1, the
> > sphere gets really stretched out. It looks like it's being stretched
towards
> > a vanishing point at the center of the field of view. Perhaps it is
alway
> > stretched parallel to CamD, but it isn't noticeable when the zoom is
high
> > and the camera is far away.
>
> I never use a zoom of .1, and rarely use one below 2, so I don't
experience
> this problem.
>
> One thing you can do is to render the stopwatch as a series of GIFs and
use
> them as small image-mapped polygons in the corner of the screen; since
they
> are flat, they will not be distorted.
>
> > 2) If CamLoc is located along the Y axis, I get "error: Singular matrix
in
> > MInvers."
>
> This is a problem when the vector from CamLoc to CamEye is parallel to
> CamSky. You appear to be using a z-up, y-forward camera system, or are
shooting
> for a bird's eye view; in either case, change CamSky to point in some
other
> direction (CamSky=z, for instance).
>
> > 3) I notice with text (replacing the sphere) that has depth, that the
depth
> > is more visible the further the text is from the center of the field of
> > view. I can give the text an aribrarily small depth , but it would be
nice
> > to be able to give it zero depth so it is always flat. Is there a way?
>
> Yes. Specify zero depth. It's perfectly legal.
>
> > 4) I need a fudge factor, greater than 1, in the camera location
position,
> > otherwise the text disappears. I think it is directly to the right of
the
> > camera and therefore is not in the field of view.
>
> Fudge factoring the camera location is WRONG for the effect we're trying
> to achieve here. You're looking for a way to place the text so that if
> follows the camera; therefore if it doesn't, alter the text placement, and
> NOT the camera placement.
>
> Remember that when text is declared, it is placed at the origin, with its
> depth extending in the positive z direction, and the width going in the
> positive x direction. Move the text when you declare it, and then apply
> the matrix, like this:
>
> text { ttf "myfont.ttf", "Text",0,0
> translate -x*TextWidth // you need to figure out how wide this is
> scale .1 // to make it smaller
> translate <2/3-.05,-.45,CamZoom>
> matrix < CamR.x,CamR.y,CamR.z, CamU.x,CamU.y,CamU.z,
> CamD.x,CamD.y,CamD.z, CamLoc.x,CamLoc.y,CamLoc.z >
> }
>
> Regards,
> John
>
> --
> ICQ: 46085459
Post a reply to this message
|
![](/i/fill.gif) |