Importing heightfield using regular LUA API

Typically: "How do I... ", "How can I... " questions
Post Reply
Ra-rep
Posts: 2
Joined: 12 Mar 2019, 22:09

Importing heightfield using regular LUA API

Post by Ra-rep » 16 May 2019, 02:36

Hello,

I initially had created several heightfield shapes (in .csv format) for manual importing, however, now I want to import them using the API functions.
I was looking into simCreateHeightfieldShape for creating the heightfields and trying to use simImportShape to achieve the same, but it seems that I will have to remake all the heightfields because CSV isn't supported by these functions.
I keep getting "Operation Failed" when specify the path to the csv files in these functions.

Is there any other function that would allow me to use the CSV files without modification?

Also, could you provide an example of the "xPointCount/yPointCount" and "table heights" parameters in simCreateHeightfieldShape.
If I have understood this correctly, xPointCount and yPointCount specify the heightfield's resolution and table heights should, therefore, be a 2D LUA table with {xPointCount} rows and {yPointCount} columns.

Thanks!

fferri
Posts: 304
Joined: 09 Sep 2013, 19:28

Re: Importing heightfield using regular LUA API

Post by fferri » 16 May 2019, 09:31

Ra-rep wrote:
16 May 2019, 02:36
Also, could you provide an example of the "xPointCount/yPointCount" and "table heights" parameters in simCreateHeightfieldShape.
If I have understood this correctly, xPointCount and yPointCount specify the heightfield's resolution and table heights should, therefore, be a 2D LUA table with {xPointCount} rows and {yPointCount} columns.
no, heights is a 1D array of xPointCount*yPointCount values

Ra-rep
Posts: 2
Joined: 12 Mar 2019, 22:09

Re: Importing heightfield using regular LUA API

Post by Ra-rep » 17 May 2019, 05:11

Thanks for the reply fferri!

I'll try it out again with a 1D array.

Post Reply