isometric

Isometric Screen to Map

强颜欢笑 提交于 2019-12-05 01:35:25
问题 I'm trying to figure out how I can get the correct "active" tile under the mouse when I have "ramp" and +1 height tiles (see picture below). When my world is flat, everything works no problem. Once I add a tile with a height of say +1, along with a ramp going back to +0, my screen -> map routine is still looking as if everything is "flat". In the picture above, the green "ramp" is the real tile I want to render and calculate mouse -> map, however the blue tile you see "below" it is the area

sf::Texture applied in a wrong way

笑着哭i 提交于 2019-12-04 17:59:24
问题 In my 2D isometric engine, I have the following classes : `maps(variable)/layers(variable)/cubes(variable)/sides(6)/points(4)/coordinates(3)` Each sides contains 4 points (1 point = 1 coordinate (x, y, z)). Each cubes contains 6 sides. I can create a map with the size i want with cubes(same, the size i want). Folers: assets/numTexture/numLight.png I calcule with numTexture and numLight a number wich is the textureNumberEntry(i loaded all numLight.png(textures) in an array). But texturing

Tiled Map Editor: size of isometric tile side

你离开我真会死。 提交于 2019-12-04 15:32:43
In Tiled editor there is an isometric map example: "isometric_grass_and_water.tmx". This example shows simple isometric map with tiles which have size 64x32 pixels. I need to know size of the side of a tile, so I simply used Pythagorean theorem for this: In right-angled triangle ABC side AC = width / 2 = 32 and side AB = height / 2 = 16. Thus side of a tile (BC) can be calculated as: So whole tile is a rhombus in which each side = 35.777. However when I add an square object with dimensions 35.77 x 35.77 to the Tiled, it not fits into the grid (it is actually bigger than on tile). But if I add

WebGL Isometric projection

隐身守侯 提交于 2019-12-03 22:14:23
问题 Alright- going nuts here. I'm doing some WebGL and I'm trying to make an isometric cube. I don't want to use Three.js. I want to first understand what is going wrong in my code. I've been researching and the only tutorials I can find seem to be for OpenGL At any rate- here's my drawScene function: function drawScene() { this.gl.clear(this.gl.COLOR_BUFFER_BIT | this.gl.DEPTH_BUFFER_BIT); mat4.perspective(45, this.gl.viewportWidth / this.gl.viewportHeight, 0.1, 100.0, pMatrix); mvMatrix = mat4

sf::Texture applied in a wrong way

ぃ、小莉子 提交于 2019-12-03 11:50:50
In my 2D isometric engine, I have the following classes : `maps(variable)/layers(variable)/cubes(variable)/sides(6)/points(4)/coordinates(3)` Each sides contains 4 points (1 point = 1 coordinate (x, y, z)). Each cubes contains 6 sides. I can create a map with the size i want with cubes(same, the size i want). Folers: assets/numTexture/numLight.png I calcule with numTexture and numLight a number wich is the textureNumberEntry(i loaded all numLight.png(textures) in an array). But texturing gones wrong: I define my cubes coordinates in the layer class : for(int J = 0; J < mapSize; J++) { for(int

Efficiently getting isometric grid positions within a bounding box

﹥>﹥吖頭↗ 提交于 2019-12-03 11:27:11
问题 I have an isometric grid system who's coordinates start from [0,0] in the left hand corner of the grid (The corner shown in the above image) with x incrementing towards the bottom of the image and y incrementing towards the top (so [0, height] would be the top corner and [width, 0] would be the bottom corner in a diamond shape with width and height being the size of the grid ie. 200 x 200 squares) Anyways what I need help with is getting an array of isometric grid positions that are contained

HTML/JS/CSS Isometric Grid with semi-transparent click-through tiles

﹥>﹥吖頭↗ 提交于 2019-12-03 08:40:10
问题 I'm trying to create a web app/game that uses a side-on 'isometric' view and transparent tiles. I can display them ok (but not great) using a PHP formula that just sets each div (each tile) as position:absolute and set the top and left parameters. The problem is how do I catch clicks on a tile and let tiles with transparent bits click-through to the tile below it. An example of my problem is at http://stuff.adammw.homeip.net/other/fv/farmville_2.html 回答1: You won't be able to do this with the

Swift Spritekit isometric map touch location

好久不见. 提交于 2019-12-03 07:32:51
I've started doing a small swift / spritekit project to teach myself game dev. It starts with an isometric map, which I managed to draw. But I'm having trouble getting a precise touch location on the different tiles of the map. It works, but is slightly out of place, and does not seem consistent. Here are my functions : class PlayScene: SKScene { let map = SKNode() override func didMoveToView(view: SKView) { let origin = view.frame.origin let mapOrigin = CGPointMake(origin.x + self.frame.width / 4, origin.y - self.frame.height / 4) let mapConfig: Int[][] = [[0, 0, 0, 0, 1, 0, 0, 0], [0, 0, 0,

mouse position to isometric tile including height

烈酒焚心 提交于 2019-12-03 04:14:40
问题 Struggeling translating the position of the mouse to the location of the tiles in my grid. When it's all flat, the math looks like this: this.position.x = Math.floor(((pos.y - 240) / 24) + ((pos.x - 320) / 48)); this.position.y = Math.floor(((pos.y - 240) / 24) - ((pos.x - 320) / 48)); where pos.x and pos.y are the position of the mouse, 240 and 320 are the offset, 24 and 48 the size of the tile. Position then contains the grid coordinate of the tile I'm hovering over. This works reasonably

Efficiently getting isometric grid positions within a bounding box

北城余情 提交于 2019-12-03 01:44:58
I have an isometric grid system who's coordinates start from [0,0] in the left hand corner of the grid (The corner shown in the above image) with x incrementing towards the bottom of the image and y incrementing towards the top (so [0, height] would be the top corner and [width, 0] would be the bottom corner in a diamond shape with width and height being the size of the grid ie. 200 x 200 squares) Anyways what I need help with is getting an array of isometric grid positions that are contained within the blue box shown in the image. Short of iterating over every x,y screen pos and getting the