parrgar21 / heekscad

Automatically exported from code.google.com/p/heekscad
Other
0 stars 0 forks source link

align view to coordinate system #211

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
When a coordinate system has been made or edited, we should move the camera
to align with it. This should be optional, though, but on by default.
Also there should be a right-click function to "align camera", when the
user right-clicks on the coordinate system. ( this does not include the
"lock the orientation" mentioned below )

This is from Peter Long's request:
"Once a coordinate system has been chosen/defined it would be nice to have
the option to automatically align the grid to the drawing plane and lock
the orientation parallel to the screen, and x axis horizontal."

Original issue reported on code.google.com by danhe...@gmail.com on 14 Oct 2009 at 6:48

GoogleCodeExporter commented 8 years ago
I was working a little on having sketches be in different coordinate systems. 
There
are several problems with it. One of them is the need for this aligning the 
view to
the coordinate system. Another is that we need the grippers to be projected 
onto a
plane. I think the best way to do this is to have a global matrix for the 
coordinate
system. Like m_current_coordinate_system or something. This will be a matrix 
that
maps the regular plane onto the world coordinate system. So the plane is 
assumed to
be at 0,0,0, with x vector 1,0,0, y vector 0,1,0, and z_vector 0,0,1. The final
problem is with actually figuring out what this matrix is. Simply using the
coordinate system of the sketch is not good enough because the sketch could be 
on the
face of a solid with its own transformation, that is part of a part with its own
transformation, that is in an assembly and so on. This is even worse if you 
consider
multiple references to the same object. 

I think the place to do this is with the glPick code. Right now the glName is 
just a
heeks object. But it should be a tuple of the object and the current view 
matrix.
This gives a unique name for each instance of an object. Then this view matrix 
can be
multiplied by the inverse of the heekscad view matrix, ie which angle and zoom 
we are
looking at it with, to yield the transformation for the plane. 

This should work out of the box for solids and everything. The projecting on a 
plane
part should probably not project onto the plane. But the grippers should still 
be
transformed by this matrix. 

Original comment by jonpry@gmail.com on 14 Oct 2009 at 8:08