nrahnemoon / convextransformationplanning Goto Github PK
View Code? Open in Web Editor NEWFinal project for 16-782. O(1) planner for 2-D worlds (can be ported to 3D).
Final project for 16-782. O(1) planner for 2-D worlds (can be ported to 3D).
Ray will have startX, startY, endX, endY. For now, just assume startX and startY are row 38, col 16 for the dick_map.bmp. Then ray trace at some resolution.
startX, startY will be the center of the circle. endX and endY needs to be calculated based on the following criteria
The map will be white (0) in all locations that are open and black (1) in all locations that are obstacles.
This task will involve reading a bmp image file, creating a Cell*** map. Such that Cell* points to a cell object. Cell** points to a col of cells. Cell*** points to a row of columns of cells. Similar to Project 2.
As far I can tell, all the Cell has to store is whether it's 0 or 1 (i.e., it's value).
So if there are 100 border cells, can we just make a square that's ceiling(100/4) cells by ceiling(100/4) cells?
I.e., we're not really making a circle, but rather a square. Seems ok.
Only question then, is what happens when you have 101 cells? There will be empty cells along the perimeter. What do you think? I think that's fine if there are empty cells along the border, so long as the interior is filled up. We should spread the empty border cells.
I.e., We have 26 x 26 for 101 cells. But we need to make sure the 3 empty cells are far away from each other, so that the cells on the interior of the empty cells get filled up by the empty cells' neighbor.
Figure out all the cells that are open that are on the border of being closed.
This is very simple. Just loop through all the cells, if a cell has value 0 and has any neighbor that's a 1, then it's a border cell.
Then the tricky part... the border cells need to be ordered such that the ray going through the center to the border cell is moving in a clockwise direction.
To do this, add a variable to the Cell object which keeps track of angle to start. Write a comparator class that uses the angle to start to compare 2 cells. Fill in the angle to start for all the border cells. Push all the border cells onto a priority queue, pop them off and they'll come off sorted ordered by angleToStart.
We'll use this "Vector<Cell*> borderCells" to create the transformed version of the map.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.