Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / Another Box2d question

Author
Message
DcZee
23
Years of Service
User Offline
Joined: 28th Apr 2003
Location:
Posted: 18th Oct 2010 07:24
In the pinball tutorial, the author uses INKSCAPE to create the collision bounding shape for the pinball table.

He converts the curves to lines and then saves out the line data.

The line data is then used in the program to build the bounding area for the table.

I cannot find in INKSCAPE where to export the line data. I can convert the curves to straight lines, but I have not found a way to export the line data.

If anyone uses inkscape to do this could you please detail the menu selections in inkscape to make this happen.

The closest Ive come so far is to save the file in POV format, then hand bomb the line data from POV to my program.

Well at least we know he ain't rabid!
SH4773R
16
Years of Service
User Offline
Joined: 18th Jan 2010
Location: AMERICA!!!
Posted: 18th Oct 2010 07:34
Sorry idk but check dbpros help files index for the command
BatVink
Moderator
23
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 18th Oct 2010 10:22
The data isn't exported, it's simply read from the status bar for each line coordinate.

A small Box2D editor would be a nice feature, and probably not too difficult.

DcZee
23
Years of Service
User Offline
Joined: 28th Apr 2003
Location:
Posted: 18th Oct 2010 16:09
Ouch. Tediosity LOL. It would be much simpler to dump the pov file and edit the resulting data table.

Great idea! Necessity is the mother of invention. I have seen some incorporations of box2d with actionscripts, so a DBPro friendly level editor would be just the ticket.

How about ProMotion? It mentions a tile editor. Maybe it includes other functions that would be appropriate to this application?

Well at least we know he ain't rabid!
Diggsey
20
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 18th Oct 2010 20:36
No, it's much less tedious than that!

Just go to Edit->XML Editor and choose the node you want to export. There should be a field called 'd' which contains all the vertex positions as pairs of numbers separated by ',' and delimited by spaces.

I used regex to do a find and replace on the data to produce the 'data' statements in the code.

[b]
DcZee
23
Years of Service
User Offline
Joined: 28th Apr 2003
Location:
Posted: 26th Oct 2010 19:43
Thanks Diggsey! I had visions of mousing my way around the object copying x,y data. That sounds much simpler LOL.

Well at least we know he ain't rabid!
DcZee
23
Years of Service
User Offline
Joined: 28th Apr 2003
Location:
Posted: 26th Oct 2010 22:35
Hey Diggsey

I gave the XML readout a try but I ran into a curious problem. The y coordinate points do not match up. All the X coordinates are fine but the Y coordinates are way off. They are not displacement values either.

I then dumped the file in .pov format. All the x,y coordinates are correct in the pov file.

Any idea why this is happening?

Well at least we know he ain't rabid!
DcZee
23
Years of Service
User Offline
Joined: 28th Apr 2003
Location:
Posted: 30th Oct 2010 16:36
Ok, the Y coordinates are referenced from the screen edge relative to the display window. Very odd way of doing it. You would think it would relate to the drawing page as a standalone entity, referencing the coordinates within the drawing area.
It will be much easier to use the pov dump and then cut and paste into the data statements.

Well at least we know he ain't rabid!
Neco
18
Years of Service
User Offline
Joined: 13th Jul 2008
Location: Waterloo, Wisconsin USA
Posted: 30th Oct 2010 17:47
Might be worth it to see if you can script (or write a quick program) what you are doing, that is working for you.

It's pretty much what Diggsey describe, except you'll be parsing your POV file (vs doing it manually) with regular expressions and then building your data statements, etc..

Login to post a reply

Server time is: 2026-07-22 04:37:55
Your offset time is: 2026-07-22 04:37:55