SciKit-Surgery / scikit-surgerybard

BARD: The Basic Augmented Reality Demo, used at MedICSS summer school.
https://scikit-surgerybard.readthedocs.io/
Other
7 stars 3 forks source link

How to use a model with colours and textures? #83

Open rohang1411 opened 2 years ago

rohang1411 commented 2 years ago

Hey, I have a .obj model and I'm converting into .stl format to use it since .obj files are not supported. But in the process I'm loosing the colours and texture since .stl files don't have texture information. Can anyone please suggest how can I incorporate those as well in the overlay. Maybe by using any other format which supports colours and textures and is it supported by the code?

Also all the models I try come with red colour is there an option to change that?

thompson318 commented 2 years ago

BARD and sktutorial01 both use sksurgeryvtk for display. sksurgeryvtk doesn't currently support texture mapping, sorry. You could implement it separately, acting directly on the vtkActors, see here for a starting point.

The good news is that setting colours is more straightforward. In the directory where your models are located you need a colours.txt file, like this one. Each line has the name of the model file, followed by its desired colour in RGB format.