To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.cad.devOpen lugnet.cad.dev in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 CAD / Development / 4744
4743  |  4745
Subject: 
Re: Math Help Needed PLEASE
Newsgroups: 
lugnet.cad.dev
Date: 
Mon, 19 Jun 2000 12:45:55 GMT
Viewed: 
1995 times
  
In lugnet.cad.dev, Michael Lachmann writes:
> Hy,
> 
> I'm running into math problems again, after I recogniced whats the problem
> with the movements in MLCad. Now here is what I would like to do:
> 
> There is a virtual grid which is bound to a part. The distance of the grid
> lines is given by a vector 'GRID' [x-spacing, y-spaceing, z-spacing] (e.g.
> default for coarse grid [10, 8, 10]. This grid rotates together with the part
> so a rotation-matrix 'RM' is available. I assume the origin of the grid to be
> the same as the origin of the part and the offset is a vector 'OFF'.
> Now the user views the part (and invisible) the virtual grid seen from a
> certain side given by the view-rotation-matrix 'VM'. If this matrix is [1,0,0
> 0,1,0 0,0,1] the part and grid is show from FRONT.
> 
> The user can move the move the part in x and y direction (which actual axes
> depend on the view-rotation-matrix). I need to know where is the nearest point
> on the grid for a given screen point 'PS' [x, y, z] (translated into model
> space already)
> 
> I sum. everything now:
> 
> Given is a vector 'GRID', a rotation matrix 'RM' (for part and grid), a view-
> rotation-matrix 'VM' and a screen point 'PS'.
> 
> Searched the snapped screen point 'SPS' which is snapped to the nearest grid
> point.


Transform PS from model space to unrotated part space.
Round the x, y, z values to the nearest grid points.
   (add half a grid size, divide by grid size, multiply by grid size)
Transform PS back to model space.

I think this algorithm may be covered by the GPL though.  You'll have to
publish your source if you use it ;-)

Don



Message has 1 Reply:
  Re: Math Help Needed PLEASE
 
How embarrassing. Please ignore my previous post. Apparently Lars beat me to it and even brought up a point I missed. Now I have to go figure out how to retract a message. Don (26 years ago, 19-Jun-00, to lugnet.cad.dev)

Message is in Reply To:
  Math Help Needed PLEASE
 
Hy, I'm running into math problems again, after I recogniced whats the problem with the movements in MLCad. Now here is what I would like to do: There is a virtual grid which is bound to a part. The distance of the grid lines is given by a vector (...) (26 years ago, 19-Jun-00, to lugnet.cad.dev)

7 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
    

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR