Subject:
|
Re: 3D matrix math question
|
Newsgroups:
|
lugnet.cad.dev
|
Date:
|
Sun, 14 Dec 2008 03:21:30 GMT
|
Viewed:
|
12349 times
|
| |
| |
In lugnet.cad.dev, Travis Cobbs wrote:
|
In lugnet.cad, Travis Cobbs wrote:
|
In lugnet.cad, Philippe Hurbain wrote:
|
I made a quick try - and it doesnt work very well, even when it should
(between a cylinder and a cone).
Example: http://www.brickshelf.com/gallery/Philo/Misc/cedgetst1.dat (cedge
primitive is here included). Cedge seems to behave correctly on the more
sloped cone, but not on the other, it appears when it should not. Maybe
this is caused by huge scaling factor?
|
Looks like you found another LDView bug ;-). Zoom out and it works fine.
It only doesnt work when the control points are clipped by the edge of the
window. Ill have to figure out a way to fix that.
|
I think I need help. I thought I was using gluProject for the conditional
calculations, but discovered that Im not. I multiple the projection matrix
by the model-view matrix to get my transformation matrix, then run the points
through that to see how they project into 2D. Apparently, when the points
are outside the view frustum, this doesnt work right, though. Does anyone
have any suggestions on how to counteract this, or am I just stuck?
More details:
- Calculate the transformation matrix by multiplying the projection matrix by the model-view matrix.
- Transform the four 3D points in the conditional line using the transformation matrix from above, and keep the resulting X/Y values.
- If both 2D transformed control points from the conditional line are on the same side of the 2D transformed line formed by the line, then the line needs to be drawn.
The second step appears to be producing invalid results when any of the
points involved are outside the view frustum. Any help that anyone could
provide would be greatly appreciated.
--Travis
|
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.
Youll need the Z value to work out which side things lie on.
Tim
|
|
Message has 1 Reply: | | Re: 3D matrix math question
|
| (...) Actually, the projected points are all that I am checking, and that's how it's supposed to work. (...) 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 (...) (16 years ago, 14-Dec-08, to lugnet.cad.dev, FTX)
|
Message is in Reply To:
| | 3D matrix math question
|
| (...) I think I need help. I thought I was using gluProject for the conditional calculations, but discovered that I'm not. I multiple the projection matrix by the model-view matrix to get my transformation matrix, then run the points through that to (...) (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
|
|
|
|