Cleaned up new constraint line drawing while grab/rot/scale
- uses callback mechanism to tell main drawing routine what to do - for that reason it doesn't use frontbuffer drawing anymore and it shows up in all 3d windows as well - it uses the same colors as for the grid axes (I tweaked it a bit, this is based at themecolors, and also should work in different background and grid color) - I disabled drawing lines through every object or every vertex. The current display method is clear and not distracting - when in 'local' transform (double press X/Y/Z), it displays a nice axis in the center of transform for vertices. In object-mode, local transform differs per object, so constraint lines and axes are drawn for each individually... Also: - fixed an old bug in rotate transform(). Using a constraint for rotation (X, Y, Z) didn't work for multiple objects at all!
This commit is contained in:
		@@ -269,40 +269,6 @@ void helpline(float *vec)
 | 
			
		||||
	glDrawBuffer(GL_BACK);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void constline(float *center, float *dir, int col)
 | 
			
		||||
{
 | 
			
		||||
	float v1[3], v2[3];
 | 
			
		||||
	short val1[2], val2[2];
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
	VecCopyf(v1, center);
 | 
			
		||||
	VecCopyf(v2, dir);
 | 
			
		||||
	if(G.obedit){
 | 
			
		||||
		Mat4Mul3Vecfl(G.obedit->obmat, v1);
 | 
			
		||||
		VecAddf(v1, v1, G.obedit->obmat[3]);
 | 
			
		||||
	}
 | 
			
		||||
	if(G.obedit) Mat4Mul3Vecfl(G.obedit->obmat, v2);
 | 
			
		||||
 | 
			
		||||
	project_short_infiniteline(v1, v2, val1, val2);
 | 
			
		||||
 | 
			
		||||
	persp(0);
 | 
			
		||||
	
 | 
			
		||||
	glDrawBuffer(GL_FRONT);
 | 
			
		||||
	
 | 
			
		||||
	cpack(col);
 | 
			
		||||
 | 
			
		||||
	setlinestyle(0);
 | 
			
		||||
	glBegin(GL_LINE_STRIP); 
 | 
			
		||||
		glVertex2sv(val1); 
 | 
			
		||||
		glVertex2sv(val2); 
 | 
			
		||||
	glEnd();
 | 
			
		||||
	
 | 
			
		||||
	persp(PERSP_VIEW);
 | 
			
		||||
 | 
			
		||||
	glFinish(); // flush display for frontbuffer
 | 
			
		||||
	glDrawBuffer(GL_BACK);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void drawaxes(float size)
 | 
			
		||||
{
 | 
			
		||||
	int axis;
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user