Subject:
|
3D matrix math question
|
Newsgroups:
|
lugnet.cad.dev
|
Date:
|
Sun, 14 Dec 2008 02:36:26 GMT
|
Viewed:
|
12122 times
|
| |
| |
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
|
|
Message has 2 Replies: | | Re: 3D matrix math question
|
| (...) If I understand correctly you shouldn't be checking on the projection, only on the full 3D transformed points. That means you should check after stage 2.5. You'll need the Z value to work out which side things lie on. Tim (16 years ago, 14-Dec-08, to lugnet.cad.dev, FTX)
| | | Re: 3D matrix math question
|
| (...) 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 (...) (16 years ago, 14-Dec-08, to lugnet.cad.dev, FTX)
|
Message is in Reply To:
| | Re: Conditional Ring primitive?
|
| (...) Looks like you found another LDView bug ;-). Zoom out and it works fine. It only doesn't work when the control points are clipped by the edge of the window. I'll have to figure out a way to fix that. (...) It's difficult, but by using polling (...) (16 years ago, 13-Dec-08, to lugnet.cad)
|
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
|
|
|
|