Subject:
|
Re: 3D matrix math question
|
Newsgroups:
|
lugnet.cad.dev
|
Date:
|
Sun, 14 Dec 2008 14:37:43 GMT
|
Viewed:
|
14117 times
|
| |
| |
In lugnet.cad.dev, Timothy Gould wrote:
|
In lugnet.cad.dev, Travis Cobbs wrote:
|
In lugnet.cad.dev, Timothy Gould wrote:
|
If I understand correctly you shouldnt be checking on the projection, only
on the full 3D transformed points. That means you should check after stage
2.5.
|
Actually, the projected points are all that I am checking, and thats how
its supposed to work.
|
Youll need the Z value to work out which side things lie on.
|
No. The way that conditional lines work is that if the two control points
lie on the same side of the conditional line on the screen (in window
coordinates), then the conditional line should be drawn. If they lie on
opposite sides, the conditional line shouldnt be drawn. For the purposes
of determining this, the actual conditional line is considered to be
infinitely long. The Z values are irrelevant for making this determination.
Unfortunately, as far as I can tell, the projection matrix doesnt produce
useful results for points that lie outside the view frustum. But I cant
skip it entirely, because that would leave out the effects of perspective,
which are necessary in order to get the right results.
--Travis
|
Hmmm... Though I cant quite pin it down I have a suspicion that this has
something to do with the spatial reduction cause by projection. What
projection matrix are you using?
|
OK... I think I understand what I was getting at here. When you introduce
perspective then the distance of the conditional point from the line becomes
important. Eg. if you have a point that is directly behind its line in a
perspective free projection it will move towards the center by an amount
proportional to its distance behind the line (or away from it if in front). In a
perspective free projection the distance doesnt matter.
I think that one way to look at a conditional line is as a line-segment on a
predefined plane. The two points define a range of projected planar-normal
angles where the line should be displayed or not. The plane is defined by the
two points and the line and the range comes from the projection operator and two
points.
In principle I suspect that you could make use of all this to create a totaly
robust routine that worked independently of the view rostum (but not
independently of the perspective). Furthermore I think that for a perspective
free projection the cutoff will be z_cond<cos(45). In practise I think it
would be a lot of work for little reward.
|
Would a simple solution just be to move the conditional points right in close
to the original points at parse time? If the length of the conditional
vectors is unimportant then youd be decreasing the number of conditional
points that lie outside the viewing frustum. With a distance of, say, 1/10th
LDU from the line youd rarely encounter any problems.
|
So I think something along these lines (or a better works-mostly solution) would
be better.
|
|
Message has 1 Reply: | | Re: 3D matrix math question
|
| (...) I think you're right. I'll look into that. It seems like the most straightforward, and since it's just a pre-processing step, it shouldn't affect the performance for anything other than model loading. --Travis (16 years ago, 14-Dec-08, to lugnet.cad.dev, FTX)
|
Message is in Reply To:
| | Re: 3D matrix math question
|
| (...) Hmmm... Though I can't quite pin it down I have a suspicion that this has something to do with the spatial reduction cause by projection. What projection matrix are you using? Would a simple solution just be to move the conditional points (...) (16 years ago, 14-Dec-08, to lugnet.cad.dev, FTX)
|
39 Messages in This Thread:
- Entire Thread on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
This Message and its Replies on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
|
|
|
|