• Advertisement
  • Popular Tags

  • Popular Now

  • Advertisement
  • Similar Content

    • By lucky6969b
      I want to calculate the position of the camera, but I always get a vector of zeros.

      D3DXMATRIX viewMat; pDev->GetTransform(D3DTS_VIEW, &viewMat); D3DXMatrixInverse(&viewMat, NULL, &viewMat); D3DXVECTOR3 camPos(viewMat._41, viewMat._42, viewMat._43); log->Write( L"Camera Position: %f %f %f\n", camPos.x, camPos.y, camPos.z);

      Could anyone please shed some lights on this?
    • By bsudheer
      Leap Leap Leap! is a fast-paced, endless running game where you leap from rooftop to rooftop in a computer simulated world.

      This is a free run game and get excited by this fabulous computer simulated world of skyscrapers and surreal colors in parallax effect. On your way, collect cubes and revival points as many as you can to make a long run.

      Features of Leap Leap Leap:
      -Option of two themes: Black or White.
      -Simple one touch gameplay.
      -Attractive art.
      -Effective use of parallax.
      To Download the game:
      Playstore: https://play.google.com/store/apps/details?id=com.avakaigames.leap
      Appstore: https://itunes.apple.com/us/app/leap-leap-leap/id683764406?mt=8

    • By isu diss
      I'm following rastertek tutorial 14 (http://rastertek.com/tertut14.html). The problem is, slope based texturing doesn't work in my application. There are plenty of slopes in my terrain. None of them get slope color.
      float4 PSMAIN(DS_OUTPUT Input) : SV_Target { float4 grassColor; float4 slopeColor; float4 rockColor; float slope; float blendAmount; float4 textureColor; grassColor = txTerGrassy.Sample(SSTerrain, Input.TextureCoords); slopeColor = txTerMossRocky.Sample(SSTerrain, Input.TextureCoords); rockColor = txTerRocky.Sample(SSTerrain, Input.TextureCoords); // Calculate the slope of this point. slope = (1.0f - Input.LSNormal.y); if(slope < 0.2) { blendAmount = slope / 0.2f; textureColor = lerp(grassColor, slopeColor, blendAmount); } if((slope < 0.7) && (slope >= 0.2f)) { blendAmount = (slope - 0.2f) * (1.0f / (0.7f - 0.2f)); textureColor = lerp(slopeColor, rockColor, blendAmount); } if(slope >= 0.7) { textureColor = rockColor; } return float4(textureColor.rgb, 1); } Can anyone help me? Thanks.

    • By elect
      ok, so, we are having problems with our current mirror reflection implementation.
      At the moment we are doing it very simple, so for the i-th frame, we calculate the reflection vectors given the viewPoint and some predefined points on the mirror surface (position and normal).
      Then, using the least squared algorithm, we find the point that has the minimum distance from all these reflections vectors. This is going to be our virtual viewPoint (with the right orientation).
      After that, we render offscreen to a texture by setting the OpenGL camera on the virtual viewPoint.
      And finally we use the rendered texture on the mirror surface.
      So far this has always been fine, but now we are having some more strong constraints on accuracy.
      What are our best options given that:
      - we have a dynamic scene, the mirror and parts of the scene can change continuously from frame to frame
      - we have about 3k points (with normals) per mirror, calculated offline using some cad program (such as Catia)
      - all the mirror are always perfectly spherical (with different radius vertically and horizontally) and they are always convex
      - a scene can have up to 10 mirror
      - it should be fast enough also for vr (Htc Vive) on fastest gpus (only desktops)

      Looking around, some papers talk about calculating some caustic surface derivation offline, but I don't know if this suits my case
      Also, another paper, used some acceleration structures to detect the intersection between the reflection vectors and the scene, and then adjust the corresponding texture coordinate. This looks the most accurate but also very heavy from a computational point of view.

      Other than that, I couldn't find anything updated/exhaustive around, can you help me?
      Thanks in advance
    • By drcrack
      It is a combination of fundamental RPG elements and challenging, session-based MOBA elements. Having features such as creating your unique build, customizing your outfit and preparing synergic team compositions with friends, players can brave dangerous adventures or merciless arena fights against deadly creatures and skilled players alike.

      This time with no grinding and no pay to win features.

      We're still looking for:
      1) 3D Character Artist
      2) 3D Environment Artist
      3) Animator
      4) Sound Designer
      5) VFX Artist

      Discord https://discord.gg/zXpY29V or drcrack#4575
  • Advertisement
  • Advertisement

3D How is it possible to locate pavement area of the roads in the scene?

Recommended Posts

Upon building a grid on the scene, how do I identity the pavement area of the road, if I build a grid on it, the grid cells will cover the center of the road plus the pavement, as in road network pathfinding, I need to separate them and treat pavement as blockers....



Share this post

Link to post
Share on other sites

I don't know if this is the correct way to do it, but maybe use an octree of the grid to check to see if an object is within the current grid, for a object with that a certain material, or identifier. If so, divide that grid by half and check both the smaller boxes. After narrowing it down enough, then use ray-testing.

Share this post

Link to post
Share on other sites

Are you talking about excluding the road from a search area? Say like excluding it from the Open List of an algorithm like A*. If so I'm assuming you already have some internal structure representing Tiles. You could expound on this by adding an enumeration for type. like, uh, say

enum tile_type { ROAD, SIDE_WALK, DIRT, ECT };

And than just conditionally parse through your tiles come search time and omit the tiles you don't want in the proposed search area.

Share this post

Link to post
Share on other sites

haha, manually tagging each one would be a pain for a large map. When you initially create your tiles, loop through them, and assign the respective tile type. So let's say, a trivial example, I'm utilizing an array for my data set for tile creation. 0 = side_walk, and 1 = road

like so:

int map [] = { 000000111000000
			   000000111000000 };

You may be using a different data set for your map creation, an image, a text file, whatever, but the key is to know what data you're working with to generate your tiles, and to give it meaning within your application.

So with the above example, since I've denoted 0 = side_walk, and 1 = road. I can loop through my dataset, and create my tiles with those appropriate types in mind

like so:

for (int i = 0; i < MY_ARRAY_SIZE; i++) 
	if (map == 0) myMapVector.push_back(new Tile(SIDE_WALK));
    if (map == 1) myMapVector.push_back(new Tile(ROAD));


Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Advertisement