Quick and Dirty Darwinia Shapefile Viewer (Perl)

Anything and everything

Moderators: jelco, bert_the_turtle, Chris

User avatar
Jackmn
level5
level5
Posts: 1378
Joined: Thu Feb 07, 2002 5:21 pm

Quick and Dirty Darwinia Shapefile Viewer (Perl)

Postby Jackmn » Sun Feb 06, 2005 4:15 am

Requires: Perl
OpenGL plugin from http://www.bribes.org/perl/wopengl.html


Program: shapeview.txt

Takes one argument, which is the shapefile name with path.

Controls:
W/S/A/D - Rotate
Q/Z - Zoom in / out

Not terribly pretty, but it does it's job.

Since I don't know how to produce the material effects (yet!), the program simply gives the models false colouring.

Example output (Incubator):
Image
Last edited by Jackmn on Sat May 07, 2005 10:33 am, edited 1 time in total.
User avatar
Starfyre
level5
level5
Posts: 3247
Joined: Sat Jun 29, 2002 3:00 pm
Location: in the tree house

Postby Starfyre » Sun Feb 06, 2005 11:37 am

Hey, that's pretty awesome :D

I think False was working on a model viewer as well.
Excellent job, though, 'll go toy with it :)
User avatar
Hektik sniper
level5
level5
Posts: 3642
Joined: Tue May 07, 2002 4:58 pm
Location: A Field with my fellow Clows.... MOOOOOOO!!!!!
Contact:

Postby Hektik sniper » Sun Feb 06, 2005 1:54 pm

nice work, will be handy ;o
elDiablo
level5
level5
Posts: 3111
Joined: Thu Mar 14, 2002 12:23 pm
Location: London, UK

Postby elDiablo » Sun Feb 06, 2005 1:58 pm

I talked to false, and he's already made a php one. However, I couldnt get it to work, so meh :P
We dont stop playing cos we get old... We get old cos we stop playing.
User avatar
false
level3
level3
Posts: 349
Joined: Fri Mar 29, 2002 5:57 pm
Contact:

Re: Quick and Dirty Darwinia Shapefile Viewer (Perl)

Postby false » Sun Feb 06, 2005 9:35 pm

Jackmn wrote:Requires: Perl
OpenGL plugin from http://www.bribes.org/perl/wopengl.html


Program: shapeview.txt

Takes one argument, which is the shapefile name with path.

Controls:
W/S/A/D - Rotate
Q/Z - Zoom in / out

Not terribly pretty, but it does it's job.

Since I don't know how to produce the material effects (yet!), the program simply gives the models false colouring.

Example output (Incubator):
Image
The coloring is pretty simple.

If you want my (horribly+quickly written) PHP code you are free to it, just ask -- the only thing it doesn't do correctly is place the objects of the models correctly.
~>
Dependent filter
Preserves port number
Does not supports hairpin of media
Cyberdyne
level1
level1
Posts: 53
Joined: Thu Mar 03, 2005 1:24 am

Postby Cyberdyne » Sat May 07, 2005 8:10 am

This is great, have you worked out the colour yet?

This could be the start of a crude model editor.

Could plot all the Positions: of the Fragment: and draw a red dot there. Select the Positions: with keys for up and down and plot a larger yellow dot on selected Position with co-ords printed on screen.
Change position with Ins/Del (x) Home/End (y) PgUp/PgDn (z), change step to move by with + and -, and save that points x,y,z with Numpad Enter in the .shp file.

I`ve been trying, but have only just got perl to try this model viewer out.
Have to learn some more.
User avatar
Jackmn
level5
level5
Posts: 1378
Joined: Thu Feb 07, 2002 5:21 pm

Postby Jackmn » Sat May 07, 2005 10:30 am

Oh, I know how the colour system works. It's just that I would have to apply lighting, otherwise solid colour objects would just appear as silhouettes.

I used to have it use the proper colours, but I really didn't feel like having to provide user controls for manipulating a light.


Best thing for editing would be to just convert the files to and from MD2. The formats are very similar (in the way points/polygons/strips are stored. MD2 isn't plain text, obviously)
Superpig
level4
level4
Posts: 658
Joined: Sat May 04, 2002 10:06 pm
Location: Right behind you
Contact:

Postby Superpig » Sun May 08, 2005 1:09 am

Cyberdyne wrote:This could be the start of a crude model editor.
It would be infinitely more worth people's time to write plugins for existing modelling packages - Wings3D, Blender, Milkshape3D, etc.
Superpig
- Saving pigs from untimely fates
Icepick
level5
level5
Posts: 7528
Joined: Wed Oct 24, 2001 10:29 pm
Location: Bradford, England

Postby Icepick » Sun May 08, 2005 2:53 pm

There is a plugin for 3dsmax, which last I heard, Chris was checking the legality of releasing it before he did so, along with the model files from the game.
Falling Guy
level1
level1
Posts: 43
Joined: Mon May 02, 2005 5:28 pm

Postby Falling Guy » Sun May 08, 2005 3:54 pm

Plender would be good to have a plugin for, its free, open source and works on lots of OSs.
Fall, dont fly.
User avatar
MicrOchiP
level1
level1
Posts: 26
Joined: Mon Apr 11, 2005 11:57 pm
Location: Portugal

Postby MicrOchiP » Sun May 08, 2005 9:01 pm

Icepick wrote:There is a plugin for 3dsmax, which last I heard, Chris was checking the legality of releasing it before he did so, along with the model files from the game.


do you know the name of the plugin ?
The standard 3DMax SHP importer doesn´t recognize the darwinia files.
-=MicrOchiP=-
User avatar
#fookin.RedOctober
level1
level1
Posts: 46
Joined: Fri May 06, 2005 5:39 am
Location: England

Postby #fookin.RedOctober » Sun May 08, 2005 9:37 pm

Not only that you could cut out any uneeded bits and end up with your own specialist model editor.

If only I could get my WiFi card to work with linux, I'd of moved linux 5 years ago if I had been able to get modems to work with it.
User avatar
MicrOchiP
level1
level1
Posts: 26
Joined: Mon Apr 11, 2005 11:57 pm
Location: Portugal

Postby MicrOchiP » Thu May 12, 2005 7:49 pm

does anyone knows were to find a opengl module for perl (win32) ?
-=MicrOchiP=-
User avatar
Jackmn
level5
level5
Posts: 1378
Joined: Thu Feb 07, 2002 5:21 pm

Postby Jackmn » Fri May 13, 2005 12:13 am

It's linked in the first post mate.
User avatar
MicrOchiP
level1
level1
Posts: 26
Joined: Mon Apr 11, 2005 11:57 pm
Location: Portugal

Postby MicrOchiP » Sat May 14, 2005 12:22 am

that one is offline.

EDIT: its up, sorry for the inconvenience :oops:
-=MicrOchiP=-

Return to “General”

Who is online

Users browsing this forum: No registered users and 2 guests