![]() ![]() ![]() Or if it detects an obstacle in a cell change that cell color. At one instance all cells are white, then as the robot moves I change the color of the corresponding cell. For example I may have a grid of 100x100. The most dynamic aspect of the grid is the fill color. What if I want to draw a 10000x10000 grid cell (zoom out far for example), or if the color is changing a lot. I am just not sure what is the best scalable, or performant approach. Use a texture/image of NxN and update the texture pixel colors. ![]() 1x1, etc) for each grid and have the shaders draw the individual squares, if possible. Having all the real world center or corner coordinates(0x0, 0x1. Then have a vertex array object/buffer with all the indicies and colors, but wondering how to handle changing colors during run time. Having a square shader (two triangle vertices and index buffer) with a color attribute. What OpenGL method/approach should I take? I am currently thinking of: Add some form of scrolling or following (probably done through MVP camera).Now 0x0 should be white color, and 1x1 should be red. For example if the robot starts in 0x0 the cell is red, then the next instance it moves to 1x1. Might add user click on cell and it change color. Change the color of each cell based on some criteria.Change the resolution, or size of each grid cell.This is for a small robot project I am working on. My goal is to be able to create what is called an Occupancy grid, its similar to a tile/grid game, looks like the attached image. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |