Subject:
|
Re: 3D matrix math question
|
Newsgroups:
|
lugnet.cad.dev
|
Date:
|
Sun, 14 Dec 2008 08:19:53 GMT
|
Viewed:
|
12356 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
|
I am not the best in 3D, but if something outside the view frustum, you do not
need to draw that. If you have the special case that only parts of what you
should draw are outside the view frustum, I would go to calculate that values
for a viewpoint far away, that all of the model is in the view frustum and then
I keep that values and do a zoom.
Maybe this would help.
cu
mikeheide
|
|
Message has 1 Reply: | | Re: 3D matrix math question
|
| (...) In the case that exhibits the bug, the control points are outside the frustum, but the conditional line itself isn't. So I still need to decide whether or not to draw the conditional line. In this case, it was being drawn at times that it (...) (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
|
|
|
|