Getting acces to texture coordinates

Typically: "How do I... ", "How can I... " questions
Boris
Posts: 21
Joined: 14 Jun 2017, 12:40

Getting acces to texture coordinates

Post by Boris » 14 Jun 2017, 14:32

Hello coppelia,

I have a project where the goal is to render a v-rep scene in HTC-vive glasses.

Currently I am writing an external application using the vtk library. The idea is to transfer geometry from a v-rep scene to the application. The pose of objects are synchronised using the external c++ api. Currently the geometry is transferred using a child script using a custom function.

The only problem that I have is that there seems no way of getting texture coordinates of a mesh. The only mentioning of texture coordinates I found is in examples v_repExtExternalRender and v_repExtPovRay. But I don't see how I can acces them otherwise.

Is there any option to retrieve texture coordinates using the internal api or external api? If not, do you thing it is possible to create an external render plugin and transfer the geometry in some way to the external application? Or is there some other way?

Kind regards and thanks in advance,
Boris Bogaerts

coppelia
Site Admin
Posts: 6867
Joined: 14 Dec 2012, 00:25

Re: Getting acces to texture coordinates

Post by coppelia » 16 Jun 2017, 07:42

Hello Boris,

unfortunately you cannot access texture coordinates with the current API.
In the plugins you mention, a vision sensor is handing over to the plugin the elements to render, this also includes the textures. But shapes will be treated as individual elements if they are compound shapes. Also only the shapes in the field of view will be handed over.

Cheers

Tobias
Posts: 21
Joined: 08 Jan 2016, 14:35

Re: Getting acces to texture coordinates

Post by Tobias » 05 Jul 2017, 14:38

HI everybody,

is there any success in rendering a scene / a stereo vision camera to the HTC Vive?

Cheers, Tobi

coppelia
Site Admin
Posts: 6867
Joined: 14 Dec 2012, 00:25

Re: Getting acces to texture coordinates

Post by coppelia » 06 Jul 2017, 16:15

Hello,

this can probably be done in a not-so-easy / not-so-elegant / not-so-efficient fashion by creating 2 vision sensors and streaming the respective pictures (via ROS or the remote API for instance) to an external application that will crop and stitch the images into the correct image.

Sorry for not being able to be more precise.

Cheers

Boris
Posts: 21
Joined: 14 Jun 2017, 12:40

Re: Getting acces to texture coordinates

Post by Boris » 19 Aug 2017, 15:54

Hello Everybody,

The approach I used with VTK works reasonably well. I have an external program that runs a child script inside V-REP which hands geometry/names/colors/opacity/etc to the external application. This geometry is put in a vtkOpenVRRenderWindow. Positions are updated every frame.

One annoying thing is that there is no way of getting texture coordinates of objects. To solve this I replace geometries with texture coordinate, with the geometry from the original .obj file which leads to satisfactory results, but complicates the code a lot.

This VTK solution is not as stable/easy to modify as I expected. A better option is maybe to port the geometry to Unity, but currently I have no time to test this.

Kind Regards,
Boris Bogaerts

coppelia
Site Admin
Posts: 6867
Joined: 14 Dec 2012, 00:25

Re: Getting acces to texture coordinates

Post by coppelia » 22 Aug 2017, 08:14

Hello Boris,

thanks for the update. Would it be helpful to have a new API function like simGetShapeMeshEx, which would retrieve the meshs, textures and texture coordinates for a given mesh?

Cheers

Boris
Posts: 21
Joined: 14 Jun 2017, 12:40

Re: Getting acces to texture coordinates

Post by Boris » 27 Aug 2017, 14:34

Hello,

This function would solve a lot of my problems. An external program that reads all visible meshes from a v-rep scene and displays them in a VR enviroment would be relatively simple and stable.

Kind regards,
Boris

Boris
Posts: 21
Joined: 14 Jun 2017, 12:40

Re: Getting acces to texture coordinates

Post by Boris » 30 Aug 2017, 13:12

Hello,

I have posted the basic interface software I developed on bitbucket https://bitbucket.org/BorisBogaerts/v-r ... -interface. If the function you mentioned becomes available, I will update the code to also include textures.

What is the best way to effectively communicate this to the V-REP community?

Kind regards,
Boris

coppelia
Site Admin
Posts: 6867
Joined: 14 Dec 2012, 00:25

Re: Getting acces to texture coordinates

Post by coppelia » 31 Aug 2017, 08:31

We can add this to the contributions and external resources section, and mention this in the change history of the user manual.
Oh and soon, we will have all the source code on a common repository, where we can refer to other repositories

We'll try to prepare a version with the textures...

Cheers

Boris
Posts: 21
Joined: 14 Jun 2017, 12:40

Re: Getting acces to texture coordinates

Post by Boris » 31 Aug 2017, 09:07

That sounds great.

Post Reply