Plotting 2D coordinates and filling

The Partridge Family were neither partridges nor a family. Discuss.
Post Reply
User avatar
Asimov
Posts: 814
Joined: May 19th, 2012, 11:38 pm

Plotting 2D coordinates and filling

Post by Asimov » July 14th, 2012, 11:40 pm

Hi,

I have this box made in 3ds Max and made a little animation.
Now I reckon I could plot this in 2D coordinates, using 9 drawline lines, but I also reckon I would have a hard time filling in the green colour.

I mean how would the colour know when it hits an edge?
I was originally going to use a large sprite, but then thought if I could copy the point coordinates from max I could do it that way.

Asimov
Attachments
square2.png
square2.png (26.17 KiB) Viewed 1874 times
----> Asimov
"You know no matter how much I think I have learnt. I always end up hitting brick walls"
http://www.asimoventerprises.co.uk

User avatar
LuX
Posts: 1492
Joined: April 22nd, 2012, 12:33 pm
Location: Finland

Re: Plotting 2D coordinates and filling

Post by LuX » July 14th, 2012, 11:54 pm

If you want to fill an area with a single color, fairly fast, I can help : -P
With or without recursion, I've done both.
ʕ •ᴥ•ʔ

User avatar
chili
Site Admin
Posts: 3948
Joined: December 31st, 2011, 4:53 pm
Location: Japan
Contact:

Re: Plotting 2D coordinates and filling

Post by chili » July 15th, 2012, 3:16 am

Could be done, but the problem might be a little more complicated than you think. You'll not only need to load the 3DS max coordinates, but you'll need to rotate the points in space and project them to the screen (2D coordinates). To fill the polygons, it would be easiest to break each face down into 2 triangles and fill them with a standard scanline algorithm. We will be covering all these topics when I introduce the fundamentals of 3D, but not for a some time yet.
Chili

User avatar
Asimov
Posts: 814
Joined: May 19th, 2012, 11:38 pm

Re: Plotting 2D coordinates and filling

Post by Asimov » July 15th, 2012, 11:08 am

Hi Chilli/Lux,

Luckily for now I have cheated. I have made an animated sprite. I didn't need it as big as this and decided to go that route for now. Will show you very soon why I needed this. It is for my main menu.

Asimov
----> Asimov
"You know no matter how much I think I have learnt. I always end up hitting brick walls"
http://www.asimoventerprises.co.uk

Post Reply