Inflate An Array Of Points Which Describe A Polygon?
Jan 31, 2010how can i inflate an array of points which describe a polygon?
View 1 Replieshow can i inflate an array of points which describe a polygon?
View 1 Repliesis there a way to offset the points in a polygon without having to change each one individually the points are in an array
View 2 Replieshow can i get the points which make a polygon from a region which was derived from the polygon's points?
View 1 Replieshow can i calculate the 13 points on the polygon (see image)?
the 2 points either side of the centre points
are +/- width or height * 0.2761423749154
i have 4 known points, topLeft, topRight, bottomRight, + bottomLeft.
the polygon won't always be a regular rectangle as it is in the image
I'm making a game for a school project We've created a character that moves around the screen and creates blocks behind him as he moves around.We want to make it so that when the character moves from one edge of the screen to another, it fills the screen. So in order to do this we have a Points array that stores every point the character touches on his way to a wall.We then fill the Points array with "formsurface.fillPolygon(Points)"Now I'm wondering is there anyway we can retrieve all the points that are WITHIN or INSIDE the Points array we made? ( remember the points array simply contains the outline or the path the character created, we're filling inside that outline)
View 1 Replieshow do you draw or place a polygon/line within another polygon e.g. a circle within a triangle.
View 5 RepliesI'm trying to create an array of Points but can't seem to get it right.
I can create an array of Integers just fine.
Dim MyArray() as Integer = {1,2,3,4,5}
how can i sort an array of points...? elements added out of sequence causing wrong shapes with e.graphics.drawlines.
View 12 RepliesI'm trying to generate a list of random points of a 2d array.
ie
(1,0)
(2,1)
(1,2)
(0,0)
(0,1)
....
I need to process each array location, but I would like it to be in a random order.
I have an global array of points that i want to plot in VB. say X and Y points, and typically they have values of +/-12000. Now I've not done graphics work for a long time and when I did, I used OpenGL with C. Now I need a GUI i'm using VB 2008. Firstly, what's the best method of rendering the array of points? should I use some port of OpenGL? GDI? or what?
Secondly, can I simply print to perhaps a Panel on hit of a button? Thirdly, do I have to place any line drwing code in an "OnPaint" event handler? Finally (for now) if my array represents points in a space much larger than the painting surface, how would I scale and scroll the final image within the the proposed Panel? I look forward to your advice.
I've rewritten my program so it would be more .net friendly (meaning I try to draw in picturebox.Paint event).
I try to use DrawLines using array of points, which are added by user one by one, but I can't figure out how to force my program to only use points that have been set by user and not the whole array.
When I call DrawLines pointing at my array of eg. 10 points and only 5 had been set, I end up with a nice set of lines with the last going to the upper left corner (0,0) and supposedly staying there for 4 more points, which is unacceptable.
I think of using ReDim Preserve each time, but I am not sure if it is the most efficient way to do this.
Anyone can think of something more elegant before I implement this redim monstrosity?
I have an array of type Double() (1 x n) that I am trying to quickly plot on a graph I've already set up. The only thing I want/need to do is take my array and store it as data points (y-axis values) in the series I already have. What's the best way to do this? Also, will the data points that are plotted change as my array changes, and if not, how would I replot those new points and get rid of the old points?
View 1 RepliesI am using ODBC to read data from a pervasive PSQL database and in some scenarios, the date column can contain 00/00/0000 date. I don't really care about invalid dates so is there some way I can convert all of these un-representable dates into Null or some specific date instead of the query failing.
EDIT: The following shows the code I am using and where it is failing:
Private _connODBC As OdbcConnection
Dim dt As New DataTable
_connODBC = New OdbcConnection(txtConnectionString.Text)
_connODBC.Open()
[Code]...
i have a program(i already coded etc).Now i'm asked to make flowcharts to describe the algorithms used + test plans.Regarding flowcharts,how do i implement functions + procedures in them and about test plans--anyone knows or has some good site or notes so i know what i can do??
View 1 RepliesMaybe my questin was too impossible to unerstand, so I figured out how to ask it in more simple way. I suppose it can be best done in Visual Basic simplified code.
[Code]...
So question is how to describe in Visual Basic [Escape_key_was_pressed] function? When user don't hit Escape key, then program must NOT STOP for asking user keypress[Escape_key_press], it must go on with clicking on desktop to the end of program. SteelAce
I have in my database a table (AccessControl) that describes a sort of users "access control list" for the informations contained in the table Customers and other tables.Example: the entity CUSTOMER is marked by the EntityId #1. If a user belongs to the department #6, he can access the records of customer #16 and #31, but he can't for #14, that can viewed by user in department #3:
[code]...
How can I describe this relationship into the DbContext definition using a fluent Code First approach?
I'm having an issue when passing an object of type Dictionary(Of Int16, Polygon) as an argument to a backgroundworker so the background worker is able to access the Polygons in the Dictionary. I'm getting the typical "The calling thread cannot access this object because a different thread owns it" message.[code]...
View 2 RepliesIf I have some polygon lat lon coordinates stored in sqlserver db. how would I query it to see if a point was in contained within a polygon?
View 2 RepliesI just finished creating a program where you find the area of a 5 sided polygon. But not I want to actually draw the polygon given the coordinates
Private Sub PI_Estimation_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles Me.Paint
Dim myGraphics As Graphics
[code].....
I have a collection of latitudes and longitudes and I'll be grabbing sets of these and want to draw a polygon based on them.The datasets won't be the outline so will need an algorithm to establish which ones make up the outline of a polygon containing all the latitudes and longitudes supplied. This polygon needs to be flexible so the polygon can be concave if the points dictate that.
My code below produces a horrible looking polygon. As explain in my first post I want to create a nice concave or convex polygon based on the latlng's provided.Just need a way of plotting the outer latlngs.
function initialize() {
var myLatLng = new google.maps.LatLng(51.407431, -0.727142);
var myOptions = {
[code]....
i dont know how to do this.i need to create a macro to use on microsoft excel to calculate the area of any polygon. my problem is similar to this one: [URL]..but de vb code is not working for me.in attach i send the excel page.i also have to calculate the coordenates of the "center of mass", Cx and Cy using diferents functions.
View 1 RepliesOn click, I'd like this piece of code to create new polygon, shown in multiples with different coordinates and colors, sizes and orientation. Color and polygon in multiples works. My issue is I'd like to add more code that will allow each of the multiple polygon created scaled randomly and rotated. How to keep the polygons inside the canvas?
So far looks like this when user clicks start: [URL]
Code:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.Windows.RoutedEventArgs) Handles startButton.Click
Dim endCount As Integer = random.Next(1, 10)
Dim plotPoint As New Point
For count = 1 To endCount
[Code] .....
I'm working on a small freeware application in Visual Studio 2008 Standard that will match geographic data to a geographic position. For this I need some mathemathical functions and one of them is how to detect if a point is inside a polygon. There's a great solution for this from the Microsoft team at: [URL]
but it is in a different programming language that I do not know anything about. How can I use these functions in my program? I'm afraid that if I try to rewrite them in Visual Basic I'll make mistakes that I can't detect. To be complete, I'm not using screen graphics so I really need a mathemathical solution.
I'm trying to write a simple game ui, it is grid/tile based, and i have the grid built using grid column and row definitions and I'm successfully placing objects in various grid locations. I am currently stuck as trying to build the player object. I want a single object reference to represent the various components of the players piece.
Currently I am using a polygon to represent the piece on the grid. Eventually I want to replace this with images or something. I want to add in properties for what weapon and armor it has equipped I want properties for health
Essentially in code i want something like this
dim player1 as new playerobject
player1.polygon.points = 0,0 60,30 0,60
player1.health = 100
[Code]....
I can instantiate all this as separate variables etc, but I'd like to have a singular reference that contains all the variables, properties, objects, controls etc.
I'm using vb .net in vs 2010 (and no, I'm not looking to write in something else)
I'm trying to write a simple game ui, it is grid/tile based, and i have the grid built using grid column and row definitions and I'm successfully placing objects in various grid locations.I am currently stuck as trying to build the player object. I want a single object reference to represent the various components of the players piece.
Currently I am using a polygon to represent the piece on the grid. Eventually I want to replace this with images or something.I want to add in properties for what weapon and armor it has equipped I want properties for health Essentially in code i want something like this
dim player1 as new playerobject
player1.polygon.points = 0,0 60,30 0,60
player1.health = 100
player1.weapon = "axe"
etc
I can instantiate all this as separate variables etc, but I'd like to have a singular reference that contains all the variables, properties, objects, controls etc.I'm using vb .net in vs 2010.
I've created a polygon shape and filled which fills blue on startup.Upon toggling a check box it should be filled yellow.It doesn't go yellow (unless i step through in debugging).
[Code]...
I am writing a program wherein the user draws shapes by clicking a button for the desired shape and then clicking on points on the drawing area. I cannot figure out how to store four clicked points to create a foursided polygon. I read many articles that say use the "mousedown" command and store points in a list, I have tried but it's not working for me. To summarize, I need the user to click the polygon button, go to the drawing area, click four points and have a foursided polygon created.
View 6 RepliesI am developing the map tool application in vb.net where user can create maps. I gave the check boxes for show/hide the layers of map like village boundary(polygon), plot boundary(Polygon), roads(Lines), bore wells(points), dug wells(points), schools(points).
I am using the function RedrawMap for displaying various layers of maps as user checked the check boxes. If user click village boundary map shows the village boundary etc on panel control named "picMap".
The problem i am facing is when user check the village boundary layer map shows the boundary but when user check the next polygon layer i.e. plot boundary layer it gives the error message "5:Object is currently in use elsewhere.".
My code is as follows:
Public Sub RedrawMap(ByVal index As Integer)
Dim f As Font
'Object Style
Dim Size1 As Short
[code]....
In window textbox, I'd like to just allow 2 decimal points only. I could set text box only numeric but don't know how to limit 2 decimal points.[code]...
View 3 RepliesI want two decimal points value. I have used this code
lblNo.Text = Math.Round(CDec(txtNo.Text + (txtNo.Text * 0.2)), 2).ToString()
If i have value as 1.32 then its ok but if i have value like 2.3 it shows 2.3 but i want value as 2.30 How can i get this value.