Search Results

Search found 1510 results on 61 pages for 'barycentric coordinates'.

Page 31/61 | < Previous Page | 27 28 29 30 31 32 33 34 35 36 37 38  | Next Page >

  • OpenGL ES 2.0 equivalent of glOrtho()?

    - by Zippo
    In my iphone app, I need to project 3d scene into the 2D coordinates of the screen for some calculations. My objects go through various rotations, translations and scaling. So I figured I need to multiply the vertices with ModelView matrix first, then I need to multiply it with the Orthogonal projection matrix. First of all am on the right track? I have the Model View Matrix, but need the projection matrix. Is there a glOrtho() equivalent in ES 2.0?

    Read the article

  • The Skyline Problem.

    - by zeroDivisible
    I just came across this little problem on UVA's Online Judge and thought, that it may be a good candidate for a little code-golf. The problem: You are to design a program to assist an architect in drawing the skyline of a city given the locations of the buildings in the city. To make the problem tractable, all buildings are rectangular in shape and they share a common bottom (the city they are built in is very flat). The city is also viewed as two-dimensional. A building is specified by an ordered triple (Li, Hi, Ri) where Li and Ri are left and right coordinates, respectively, of building i and Hi is the height of the building. In the diagram below buildings are shown on the left with triples (1,11,5), (2,6,7), (3,13,9), (12,7,16), (14,3,25), (19,18,22), (23,13,29), (24,4,28) and the skyline, shown on the right, is represented by the sequence: 1, 11, 3, 13, 9, 0, 12, 7, 16, 3, 19, 18, 22, 3, 23, 13, 29, 0 The output should consist of the vector that describes the skyline as shown in the example above. In the skyline vector (v1, v2, v3, ... vn) , the vi such that i is an even number represent a horizontal line (height). The vi such that i is an odd number represent a vertical line (x-coordinate). The skyline vector should represent the "path" taken, for example, by a bug starting at the minimum x-coordinate and traveling horizontally and vertically over all the lines that define the skyline. Thus the last entry in the skyline vector will be a 0. The coordinates must be separated by a blank space. If I will not count declaration of provided (test) buildings and including all spaces and tab characters, my solution, in Python, is 223 characters long. Here is the condensed version: B=[[1,11,5],[2,6,7],[3,13,9],[12,7,16],[14,3,25],[19,18,22],[23,13,29],[24,4,28]] # Solution. R=range v=[0 for e in R(max([y[2] for y in B])+1)] for b in B: for x in R(b[0], b[2]): if b[1]>v[x]: v[x]=b[1] p=1 k=0 for x in R(len(v)): V=v[x] if p and V==0: continue elif V!=k: p=0 print "%s %s" % (str(x), str(V)), k=V I think that I didn't made any mistake but if so - feel free to criticize me. EDIT I don't have much reputation, so I will pay only 100 for a bounty - I am curious, if anyone could try to solve this in less than .. lets say, 80 characters. Solution posted by cobbal is 101 characters long and currently it is the best one. ANOTHER EDIT I thought, that 80 characters is a sick limit for this kind of problem. cobbal, with his 46 character solution totaly amazed me - though I must admit, that I spent some time reading his explanation before I partially understood what he had written.

    Read the article

  • Add a marker to an image in javascript?

    - by Richard
    Hi, Anyone know how I can add a marker to an image (not a map) in Javascript? Ideally I'd like a handler that behaves much like adding a marker to a map - i.e. onclick causes a marker to be displayed at the point that was clicked, and returns the x/y pixel coordinates of the point that was clicked. Is this possible? Cheers Richard

    Read the article

  • Saving new indicies, triangles and normals after WPF 3D transform

    - by sklitzz
    Hi, I have a 3D model which is lying flat currently, I wish for it to be rotated 90 degrees around the X axis. I have no problem doing this with the transforms. But to my knowledge all the transforms are a bunch of matrices multiplied. I would like to have the transform really alter all the coordinates of the indicies of the model. Is there a way to "save changes" after I apply a transform?

    Read the article

  • iPhone mapKit annotation for Current Location

    - by Simon
    Hello Im currently strugglung with annotations. how can i prevent the AnnotationLable for the blue GPS-point. (Here is an Image) - (MKAnnotationView *) mapView:(MKMapView *)mapView viewForAnnotation:(MKAnnotation *) annotation{ if (annotation == mapView.userLocation) { return nil; } the function above isnt working, and i realized that i can't compare two coordinates. Any hint is welcome. Simon

    Read the article

  • obtain OpenGL camera(view) matrix from openCV findhomography

    - by user1828449
    I want to build an AR application on Android by opencv and opengl. I found GL_MODELVIEW can place camera and model in world coordinates like the following link I tried to load a simple model-view matrix by gl.glLoadMatrixf(newMat, 0); and it works so I want to draw 3d model on the top of my target image if i got the four corner points of the target image because model-view matrix is needed I want to know if I can obtain the camera view matrix by opencv's findhomography

    Read the article

  • Algorithm putting point into square with maximal minimum distance

    - by Mikulas Dite
    I'm stuck on this: Have a square. Put n points into this square so the minimal distance (not necessary the average distance) is the highest possible. I'm looking for an algorithm which would be able to generate the coordinates of all points given the count of them. Example results for n=4;5;6: Please don't mention computing-power based stuff such as trying a lot of combination and then nitpicking the right one and similar ideas.

    Read the article

  • Get Lat, Long from CLLocation

    - by Marco
    Hello i have an CLLocation which is my userLocation, now in another class i have to open the maps app and make a route from the userLocation to another point. But how can i get in the another class the Coordinates of userLocation? please help me i have no idea

    Read the article

  • Get pixel's color in C++, Linux

    - by Stefan
    Hello, I'm looking for a possibility to get the color of a pixel with given screen coordinates (x,y) in c++ / Linux? Maybe something similarly like getPixel() in Windows. I spent the whole day to find sth but without any success. Thanks, Stefan

    Read the article

  • Updating / refreshing a live geojson layer | JSON & JS Variable

    - by Ozaki
    TLDR I am trying to get my geoJSON layer to update, currently it will 1. Create the vector mark, 2. Remove the vector mark, 3. Set the JS variable for lat and lon, 4. Unset the variable??? :S Hey S O. I have a geojson layer set up as follows: //GeoJSON Layer// var layer1 = new OpenLayers.Layer.GML("My GeoJSON Layer", "coordinates", {format: OpenLayers.Format.GeoJSON, styleMap: style_red}); My features are set up as follows: var latitude = 0.0; // as 0.0 it will draw the point in. var longitude = 0.0; // as 0.0 it will draw the point in. //var longitude = getlongitude; where getlongitude = JSON string of longitude. var point = new OpenLayers.Geometry.Point(longitude, latitude); pointFeature = new OpenLayers.Feature.Vector(point, null, style_red); var style_red = OpenLayers.Util.extend({}, layer_style); style_red.strokeColor = "red"; style_red.fillColor = "black"; style_red.fillOpacity = 0.5; style_red.graphicName = "circle"; style_red.pointRadius = 3.8; style_red.strokeWidth = 2; style_red.strokeLinecap = "butt"; and my layer updating function: function UpdateLayer(){ var p = new OpenLayers.Format.GeoJSON({ 'internalProjection': new OpenLayers.Projection("EPSG:900913"), 'externalProjection': new OpenLayers.Projection("EPSG:4326") }); var url = "coordinates"; OpenLayers.loadURL(url, {}, null, function(r) { var f = p.read(r.responseText); map.layers[2].destroyFeatures(); map.layers[2].addFeatures(pointFeature); }); setTimeout("UpdateLayer()",1000) } Any idea what I am doing wrong or what I am missing? Edit1 It now removes the feature (was map.layers[1]) previously... But will not add the new feature.. Edit2 I managed to get it to redraw a point but not with live data. It should draw the point at what (latitude) & (longitude) are equal to. I am trying to set latitude & longitude to some JSON string but every time straight after it sets the variable it changes it back to "undefined" as soon as it passes the line after var latitude? (using firebug & firequery to debug)

    Read the article

  • Turtle graphics in SVG?

    - by dr jerry
    Is there a equivalent in svg path to logo's turtlegraphics? instead of the hardcoded x and y coordinates, which also force me to adjust controlpoints on shifting a more relative "delta" approach. My solution should work for the FOCS (Firefox Opera Chrome Safaries ex IE) browsers. regards Jeroen.

    Read the article

  • Div positioning on a canvas with arrows bindings

    - by ideotop
    I'm searching for a little piece of javascript that can attach to a div (in data-x data-y attributes for example) the x,y coordinates of a draggable div. And then be able to draw arrows between them (using a data-targetid attribute?). If the solution can look like a simple version of graphview, jsPlumb or vizster but without the complicated library, and only in javascript/html

    Read the article

  • Alternatives to Goolgle Earth for sat image

    - by Martin Beckett
    I've been asked to add Google Earth images to a desktop app (civil engineering modelling app) I was under the impression that Google's license didn't allow you to do this. Are there any other easily accessible, and similarly high resolution, image sources anyone can recommend (Blue Marble, terraserver) ? As a bonus, any library that lets me use coordinates in a range of local map datums and convert them to Lat/Long without me having to incorporate the whole of CGAL?

    Read the article

  • URL-&coordinate based screen capturing tool

    - by Enrico Stahn
    Hello, I'm searching for a screen capturing tool which captures areas of an website/web-application based on the url. The very best for me would be an firefox/ie addon with an API accessible via javascript. Example: URL, Coordinates, Filename http://foo.com/project/show/33; rectangle:10,10,50,50; myapp-area1.jpg http://foo.com/project/show/33; rectangle:100,100,150,150; myapp-area2.jpg

    Read the article

  • How to detect if an ellipse intersects(collides with) a circle

    - by php html
    I want to improve a collision system. Right now I detect if 2 irregular objects collide if their bounding rectangles collide. I want to obtain the for rectangle the corresponding ellipse while for the other one to use a circle. I found a method to obtain the ellipse coordinates but I have a problem when I try to detect if it intersects the circle. Do you know a algorithm to test if a circle intersects an ellipse?

    Read the article

  • Plot points instead of lines? JFreeChart PolarChart

    - by billynomates
    Currently, the PolarChart joins all the coordinates with lines creating a polygon. I just want it to plot each point with a dot and NOT join them together. Is this possible? I have tried using translateValueThetaRadiusToJava2D() and Graphics2D to draw circles but it's very clunky and contrived. Any suggestions welcome!

    Read the article

  • Alternatives to Google Earth for sat image

    - by Martin Beckett
    I've been asked to add Google Earth images to a desktop app (civil engineering modelling app) I was under the impression that Google's license didn't allow you to do this. Are there any other easily accessible, and similarly high resolution, image sources anyone can recommend (Blue Marble, terraserver) ? As a bonus, any library that lets me use coordinates in a range of local map datums and convert them to Lat/Long without me having to incorporate the whole of CGAL?

    Read the article

  • How do you set the twitter user location in JTwitter?

    - by Gregg Reno
    I'm building some basic Twitter functionality into my app, and am using the JTwitter JAR to read and set status. It looks like there is a User class that can be used to set the location, but I just can't figure out how to set it with my GPS coordinates once I've got my Twitter object. Has anyone been able to set the user.location property using JTwitter? Thanks, -Gregg

    Read the article

  • WPF Writing custom Control

    - by Petoj
    I wanted to write a Custom Control that would show a family tree... so i looked on FamilyShow.... So their control inherits FrameworkElement but then every thing gets super complex... are there any easy tutorials out there that show how to implement a custom FrameworkElement with children and so on? Basically what i fail to do is this, Add child controls and show them, and when drawing getting the coordinates of the child controls...

    Read the article

  • why my code does not load the kml file ..(it is the simplest way)

    - by zjm1126
    this is my google-map code: <!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "http://www.wapforum.org/DTD/xhtml-mobile10.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" > <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <meta name="viewport" content="width=device-width,minimum-scale=0.3,maximum-scale=5.0,user-scalable=yes"> </head> <body onload="initialize()" onunload="GUnload()"> <style type="text/css"> *{ margin:0; padding:0; } </style> <!--<div style="width:100px;height:100px;background:blue;"> </div>--> <div id="map_canvas" style="width: 500px; height: 300px;"></div> <script src="http://maps.google.com/maps?file=api&amp;v=2&amp;key=ABQIAAAA-7cuV3vqp7w6zUNiN_F4uBRi_j0U6kJrkFvY4-OX2XYmEAa76BSNz0ifabgugotzJgrxyodPDmheRA&sensor=false"type="text/javascript"></script> <script type="text/javascript"> var aFn; //********** function initialize() { if (GBrowserIsCompatible()) { var map = new GMap2(document.getElementById("map_canvas")); var g = new GGeoXml("b.kml"); map.addOverlay(g); var center=new GLatLng(37.42228990140251,-122.0822035425683); map.setCenter(center, 0); } } //************* </script> </body> </html> and this is my b.kml file: <?xml version="1.0" encoding="UTF-8"?> <kml xmlns="http://www.opengis.net/kml/2.2"> <Placemark> <name>Simple placemark</name> <description>Attached to the ground. Intelligently places itself at the height of the underlying terrain.</description> <Point> <coordinates>-122.0822035425683,37.42228990140251,0</coordinates> </Point> </Placemark> </kml> why cann't show the point .. thanks

    Read the article

< Previous Page | 27 28 29 30 31 32 33 34 35 36 37 38  | Next Page >