enthought / enthought/mayavi

How to use of camera intrinsic property while texture mapping.

Open
#829 1 comment 1 reaction 0 assignees View on GitHub
Dominant language
Python
Stars
1.4k
Forks
316
Avg merge
7h 44m
Merged PRs (30d)
5

Description

I am using texture mapping technique in mayavi to apply texture to my 3D mesh. I am able to do that but it has some orientation issues. I have used following code :

> from mayavi import mlab
from tvtk.api import tvtk
import numpy as np
data=np.random.random((200,200)) #The shape of the matrix fits the image size in the original code
img = tvtk.JPEGReader()
img.file_name="img.jpg"
texture=tvtk.Texture(interpolate=0)
texture.set_input_data(bmp1.get_output())
mlab.figure(size=(300,300))
surf = mlab.surf(data,color=(1,1,1))
surf.actor.enable_texture = True
surf.actor.tcoord_generator_mode = 'plane'
surf.actor.actor.texture = texture

![textured_Env](https://user-images.githubusercontent.com/35450740/65857136-d4fa4000-e380-11e9-85f3-611cea8b6efc.png)

The image is not matching to it's corresponding points in 3D mesh. I have camera intrinsic properties along with me and I think they will be useful to solve this issue, but I don't get any option for that. Is there any way to use camera intrinsic properties while applying texture to the mesh?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.