mirror of
				https://github.com/3b1b/manim.git
				synced 2025-10-31 14:48:54 +00:00 
			
		
		
		
	Updated ThreeDCamera methods for new color scheme
This commit is contained in:
		
							parent
							
								
									983a3e0357
								
							
						
					
					
						commit
						c9ff83920c
					
				
					 1 changed files with 6 additions and 11 deletions
				
			
		|  | @ -40,22 +40,17 @@ class ThreeDCamera(CameraWithPerspective): | ||||||
|         self.rotation_mobject = VectorizedPoint() |         self.rotation_mobject = VectorizedPoint() | ||||||
|         self.set_position(self.phi, self.theta, self.distance) |         self.set_position(self.phi, self.theta, self.distance) | ||||||
| 
 | 
 | ||||||
|     def get_color(self, method): |     def modified_rgb(self, vmobject, rgb): | ||||||
|         color = method() |  | ||||||
|         vmobject = method.im_self |  | ||||||
|         if should_shade_in_3d(vmobject): |         if should_shade_in_3d(vmobject): | ||||||
|             return Color(rgb = self.get_shaded_rgb( |             return self.get_shaded_rgb(rgb, self.get_unit_normal_vect(vmobject)) | ||||||
|                 color_to_rgb(color), |  | ||||||
|                 normal_vect = self.get_unit_normal_vect(vmobject) |  | ||||||
|             )) |  | ||||||
|         else: |         else: | ||||||
|             return color |             return color | ||||||
| 
 | 
 | ||||||
|     def get_stroke_color(self, vmobject): |     def get_stroke_rgb(self, vmobject): | ||||||
|         return self.get_color(vmobject.get_stroke_color) |         return self.modified_rgb(vmobject, vmobject.get_stroke_rgb()) | ||||||
| 
 | 
 | ||||||
|     def get_fill_color(self, vmobject): |     def get_fill_rgb(self, vmobject): | ||||||
|         return self.get_color(vmobject.get_fill_color) |         return self.modified_rgb(vmobject, vmobject.get_fill_rgb()) | ||||||
| 
 | 
 | ||||||
|     def get_shaded_rgb(self, rgb, normal_vect): |     def get_shaded_rgb(self, rgb, normal_vect): | ||||||
|         brightness = np.dot(normal_vect, self.unit_sun_vect)**2 |         brightness = np.dot(normal_vect, self.unit_sun_vect)**2 | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		
		Reference in a new issue
	
	 Grant Sanderson
						Grant Sanderson