mirror of
				https://github.com/godotengine/godot.git
				synced 2025-10-31 21:51:22 +00:00 
			
		
		
		
	Improve appearance of the material editor preview
- Use lower camera FOV to show more of the sphere/box, while still fully displaying the meshes in question.
This commit is contained in:
		
							parent
							
								
									d26442e709
								
							
						
					
					
						commit
						99ac090233
					
				
					 1 changed files with 5 additions and 3 deletions
				
			
		|  | @ -155,7 +155,9 @@ MaterialEditor::MaterialEditor() { | ||||||
| 
 | 
 | ||||||
| 	camera = memnew(Camera3D); | 	camera = memnew(Camera3D); | ||||||
| 	camera->set_transform(Transform3D(Basis(), Vector3(0, 0, 3))); | 	camera->set_transform(Transform3D(Basis(), Vector3(0, 0, 3))); | ||||||
| 	camera->set_perspective(45, 0.1, 10); | 	// Use low field of view so the sphere/box is fully encompassed within the preview,
 | ||||||
|  | 	// without much distortion.
 | ||||||
|  | 	camera->set_perspective(20, 0.1, 10); | ||||||
| 	camera->make_current(); | 	camera->make_current(); | ||||||
| 	viewport->add_child(camera); | 	viewport->add_child(camera); | ||||||
| 
 | 
 | ||||||
|  | @ -177,8 +179,8 @@ MaterialEditor::MaterialEditor() { | ||||||
| 	Transform3D box_xform; | 	Transform3D box_xform; | ||||||
| 	box_xform.basis.rotate(Vector3(1, 0, 0), Math::deg2rad(25.0)); | 	box_xform.basis.rotate(Vector3(1, 0, 0), Math::deg2rad(25.0)); | ||||||
| 	box_xform.basis = box_xform.basis * Basis().rotated(Vector3(0, 1, 0), Math::deg2rad(-25.0)); | 	box_xform.basis = box_xform.basis * Basis().rotated(Vector3(0, 1, 0), Math::deg2rad(-25.0)); | ||||||
| 	box_xform.basis.scale(Vector3(0.8, 0.8, 0.8)); | 	box_xform.basis.scale(Vector3(0.7, 0.7, 0.7)); | ||||||
| 	box_xform.origin.y = 0.2; | 	box_xform.origin.y = 0.05; | ||||||
| 	box_instance->set_transform(box_xform); | 	box_instance->set_transform(box_xform); | ||||||
| 
 | 
 | ||||||
| 	sphere_mesh.instantiate(); | 	sphere_mesh.instantiate(); | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Hugo Locurcio
						Hugo Locurcio