Re: How to determine whether a Vector is in the View Frustum?

From: Jason (Jason_at_mobiform.com)
Date: 12/07/04


Date: Tue, 7 Dec 2004 14:20:17 -0800

device.viewport.near and far, or something close to that.. Ideally you
shouldnt be polling the Device for that kind of thing since it might not be
setup as you might think, or you add something later and change the device
state.

Jason

"Kevin Spencer" <kspencer@takempis.com> wrote in message
news:uK%23bJMJ3EHA.3376@TK2MSFTNGP12.phx.gbl...
>I have finally figured out that I can use Plane.Dot to test whether or not
>a
> vector is in front of the near clipping plane. All I need now is a way to
> reference the near clipping plane. I tried using device.ClipPlanes, but
> apparently that is only a collection of User-defined Clipping planes, as
> it
> errored out on me when I tried to access it.
>
> --
> HTH,
> Kevin Spencer
> .Net Developer
> Microsoft MVP
> Neither a follower
> nor a lender be.
>
> "Kevin Spencer" <kspencer@takempis.com> wrote in message
> news:ea3YXrH3EHA.3744@TK2MSFTNGP10.phx.gbl...
>> Okay, I've figured out that if the Z element of the vector is behind (
>> < )
>> the near clipping plane, I shouldn't render the text. However, although I
>> know the value used to set the near clipping plane, I don't know the
> Z-value
>> of that plane. Any ideas?
>>
>> --
>> HTH,
>> Kevin Spencer
>> .Net Developer
>> Microsoft MVP
>> Neither a follower
>> nor a lender be.
>>
>> "Kevin Spencer" <kspencer@takempis.com> wrote in message
>> news:ONWXFUH3EHA.3616@TK2MSFTNGP11.phx.gbl...
>> > I'm working on a terrain-modelling app. I"m drawing labels for objects
>> > directly on the screen. I use the Vector3.Project() method to determine
>> the
>> > position of the label on the screen. I'm checking the XY values of the
>> > returned Vector to make sure that the text is inside the screen area,
> but
>> it
>> > is drawing labels for objects that are behind the viewer, as if they
> were
>> in
>> > front (as it is drawing on the screen). I need to figure out a way to
> tell
>> > whether the vector of the object I'm using is inside the view frustum.
> Any
>> > ideas?
>> >
>> > --
>> > Thank,
>> > Kevin Spencer
>> > .Net Developer
>> > Microsoft MVP
>> > Neither a follower
>> > nor a lender be.
>> >
>> >
>>
>>
>
>



Relevant Pages