PDA

View Full Version : Is there a script for importing a list of coordinates



medicalart
04-12-2013, 01:31 PM
I have a .dat file which contains a list of x,y, z coordinates for a graph. Is there a script for importing it directly into Modeler? Thanks for you any suggestions.

nickdigital
04-12-2013, 02:53 PM
What would you do with the data?

medicalart
04-12-2013, 03:30 PM
These are graphs generated in Mathematica by someone else. The numbers represent x,y,z points that are supposed to be suspended in a box. Right now, all I have is a list. I could enter the data manually, but -ugh- don't want to if there's a better way. (They don't have the 3D module that allows LWO export. )

nickdigital
04-12-2013, 03:55 PM
So you'd end up with a model that's just a bunch of points?

medicalart
04-12-2013, 05:33 PM
Technically, it's a "scatter" graph, so the points would be substituted by little spheres. Or, I'd use boxes, and stretch them down to the baseline, like a bar graph.

nickdigital
04-12-2013, 05:46 PM
Is there an example of what a .dat file looks like?

adk
04-12-2013, 07:27 PM
I vaguely recall doing something similar via the obj file format eons ago.
Can't recall specifics but I'd make a few points in lw save out in obj, open that with some text editor & analize how it's formatted.
From memory points & polys are there as simple xyz coordinates & all you need to do is make edits /changes to your dat file to match what an obj looks like.

Can you post the dat file here ?

medicalart
04-12-2013, 08:06 PM
ADK, that's a great idea to use a text editor. Nick, the dat file I have is a list of numbers, in sets of three.
Looks like this:

1, 7, 0
2, 4.357, 5
1, 3.6, 0
1, 4, 6

nickdigital
04-12-2013, 08:18 PM
Is that's all that's in the dat file? It'll be hard for me to test my script without a real dat file. I don't wanna be parsing the file wrong.

I pm'ed you.

medicalart
04-12-2013, 08:32 PM
Will send in the a.m. Thanks.

nickdigital
04-12-2013, 09:59 PM
Technically, it's a "scatter" graph, so the points would be substituted by little spheres. Or, I'd use boxes, and stretch them down to the baseline, like a bar graph.

You should see if these scripts are of use to you.

http://alfuzai-studios.com/index02-1.html

medicalart
04-13-2013, 09:46 AM
You should see if these scripts are of use to you.

http://alfuzai-studios.com/index02-1.html

Helpful, thanks.

lertola2
04-13-2013, 12:34 PM
You can bring data into Lightwave using the .obj format. It is easy to use excel to massage your numbers into the proper format. If you just want points put a v in front of each coordinates and separate each number with a space character. Then save the file as a text file with a .obj extension. For example the four lines below will create a .obj file with four points arranged in a square.

v 1 1 0
v -1 1 0
v -1 -1 0
v 1 -1 0

medicalart
04-13-2013, 02:27 PM
You can bring data into Lightwave using the .obj format. It is easy to use excel to massage your numbers into the proper format. If you just want points put a v in front of each coordinates and separate each number with a space character. Then save the file as a text file with a .obj extension. For example the four lines below will create a .obj file with four points arranged in a square.

v 1 1 0
v -1 1 0
v -1 -1 0
v 1 -1 0

Good to know. Many thanks.

probiner
04-15-2013, 02:06 AM
Was just gonna say what lertola said. So it's just a text operation to manage. One has to be thankful for readable format files :)

Cheers

art
04-15-2013, 07:30 AM
I remember writing a script like that for someone a few years ago, but I can't find the thread anymore (I think I attached it there).

nickdigital
04-29-2013, 05:13 PM
I have a .dat file which contains a list of x,y, z coordinates for a graph. Is there a script for importing it directly into Modeler? Thanks for you any suggestions.

http://lwplugindb.com/plugin/vector-data-importer/

medicalart
04-29-2013, 06:25 PM
Perfect! Thanks.

SteveH
05-07-2013, 11:06 AM
I hate to hijack this thread - but I'm going to anyway - as it's something similar.

I've got a similar (but not exact) need where I'm moving an object vertically at a constant rate - where I have several hundred elevations given to me on an excel spreadsheet. So I'm not making an object using the spreadsheet - instead using the spreadsheet to drive an animation. I've looked at motion files in Notepad - but can't make heads or tails out of it. Is the elevations converted to meters by any chance?

Or is there a dead simple way of doing this I'm not thinking of?

medicalart
05-07-2013, 11:23 AM
Is the object moving to various X, Y, and Z coordinates? Or is it moving only in the Y, and -Y direction?

SteveH
05-07-2013, 11:27 AM
I've got an elevation which is the water surface elevation every month for the last 50 years - for 4 different lakes. They want a cross section of the lake bottom and a simple water object that moves up and down - with say 30 frames at Jan 1980, then 30 frames at Feb 1980 etc.

medicalart
05-07-2013, 11:51 AM
I don't know if this will work: Since NickDigital's script will convert data to vectors, you could then convert the vector to a motion path.

First, you'd need to export Excel data as text. Then, find out from NickDigital if there's a way to read Y-values in the absence of X and Z. The Lscript would then convert your data to vectors/curve, which could then be converted to a motion path.
I'm fuzzy on the specifics, so I hope someone else will chime in...

SteveH
05-07-2013, 11:57 AM
Medicalart thanks for the suggestion. I also found this - although I'm not sure how much it costs. It seems to do just what I need but as always cost is a factor.

http://www.exosphere3d.com/pubwww/pages/csv2mot.html

nickdigital
05-07-2013, 12:23 PM
Do these help?

http://www.lwplugindb.com/plugin/import-csv/
http://www.lwplugindb.com/plugin/path-to-motion/

nickdigital
05-07-2013, 12:34 PM
I don't know if this will work: Since NickDigital's script will convert data to vectors, you could then convert the vector to a motion path.

First, you'd need to export Excel data as text. Then, find out from NickDigital if there's a way to read Y-values in the absence of X and Z. The Lscript would then convert your data to vectors/curve, which could then be converted to a motion path.
I'm fuzzy on the specifics, so I hope someone else will chime in...

If the X value is 0 then it'll still read the Y value. You'll get a bunch of points at X=0. So a bunch of points vertically from the origin.

The suggestion of converting the points to a curve to a motion path should work. The default scale is 1 = 1 meter.

SteveH
05-07-2013, 01:18 PM
Nickdigital - thank you so much! That script import csv looks very promising. I'm trying to get an excel person here to convert what I had into the format the script needs and then give it a go. Thanks again to both of you!

edit.....

This did work perfectly. We went from excel, out to txt, used the lscript to animate the water levels. Love it when things work out. Love this forum and the helpful people as welll. Thanks again.

Dodgy
05-08-2013, 08:43 PM
Glad I could help :) I'm Mike Green by the way, the guy who wrote the csv script.

SteveH
05-08-2013, 09:08 PM
Mike

It was a huge help - thanks so much! The thought of hand entering a bazzillion key frames was something I did not want to contemplate. Instead with the help of your script I did four animations in about 10 seconds. Sweeeeeeeeet.

mdunakin
07-29-2013, 04:23 PM
Yeah, wow!, all of this info was totally great and I can't wait to test some of it out myself!
heck, for me, it was exciting just to see the little sample that made the four points appear in Modeler hahahahaha

So, thanx, I will be downloading everything now and keeping all the choice notes from the various connected threads from this one and another couple and save notes for future use. I only wanted to see how this could work for flight paths from air craft, but with what was said here about water levels and such, it got me to thinking on other things this sort of thing could be used for too, so I can envision a slew of uses for this sort of stuff.

Moocho gras guys!

..................................md :)