DirectX 11 Adding Object to Terrain - Rastertek Tutorial - visual-c++

I've been working my way through the Rastertek DX11 Terrain Tutorials getting to "Tutorial 6: Height Based Movement" Ive read through it and created, complied etc and the tutorial itself is working fine.
At the end of each tutorial it suggests what to do next and I'm stuck when it suggests to
"Place an object that randomly moves around the terrain adjusting its height based on information from the quad tree." I dont have an idea of how to do this properly.
Does anyone have a suggestion of how I would go about doing this? Either a link to a tutorial that explains how to add items as well as a terrain (which I couldn't find on the site) or just pointing me in the right direction! You might have to take a peek at the code there (found here: http://rastertek.com/tertut06.zip). Right now, the closest Ive gotten to is being able to render a 3D image from a file, but when I do that it makes the terain dissapear. So I'm clearly barking up the wrong tree. I've had a google around but that's been to no avail.
Any suggestions would be great as I'm still very new to all this.

Related

How can I replicate GitHub's app code block style in UITextView?

I am trying to create a markdown editor for fun and because I was interested in learning TextKit. I am working on iOS devices only, so I only have UIKit framework at my disposal, also I watched this WWDC18 video which explains some best practices to adopt with TextKit. At first I was really interested in knowing how to get the same result that the video shows at 22:13.
The code shown by the dev in the video makes use of AppKit and it wraps code in that rectangle by replacing the code section with a NSMutableParagraphStyle and by providing a custom NSTextBlock to the latter. As you can guess, I can't subclass NSTextBlock in UIKit and therefore I can't replicate the example shown.
I have something a little bit harder to ask though, what I really wanted to replicate is the GitHub application code block style, this is the final result that I would like to replicate:
As you can see it should have a rounded rectangle with a custom background color and also it needs to be scrollable in order to make code expand as much as it needs (I am not interested in syntax highlighting).
How can I achieve something like this if NSTextBlock is not available in UIKit?
For the moment all I have done is override NSTextStorage to set the correct font to the code section with custom NSAttributedString.
I have investigated in the app and noticed that it is managed by Ryan Nystrom which is the creator of GitHawk prior to moving to GitHub. The GitHawk markdown reader is very similar to the one that you find in the GitHub application and the funny thing is that GitHawk is open source so I took a look at that code and tried to understand how that could be replicated.
Turns out that GitHawk heavily uses IGListKit framework and parses markdown in ListDiffable elements, specifically the code blocks ListDiffables are given to a ListSectionController that created an horizontal UIScrollView to display code.
I gave up trying to understand more on this because GitHawk code is really really entangled and it is really hard, near impossible, to extract the specific functionality.

How to make a object follow another object around walls game maker language

So, i want an object to follow another one. But if the player object gets to far ahead the other one gets stuck behind a wall. So if you go round a corner and the following object gets trapped because it cant follow you since its trying to move towards the player. Which cause it to get stuck against a wall. The code i currently have for it is:
"Create Event"
path = path_add();
"Step Event"
mp_potential_path_object(path, obj_unit_1.x, obj_unit_1.y, 1, 4, obj_border);
path_start(path, 1, 0, 0);
If anyone has already posted about this please mention, thanks
Without knowing additional details for how your project/objects are laid out, I am going to offer just general idea type solutions.
1) On collision with the wall object, you can try to find the edge of the wall object using the sprite's size and add that as a point to move towards. (assuming the wall's aren't tiled and there's another wall there)
2) You can make a backup path of the player's movement, and have the following object follow that path. Assuming the path the player took is still clear and able to be moved through, any path the player moved through should be valid for the following object as well.
3) Not sure if it's in keeping with the mechanics of your game, but some game (like in diablo 3) if your follower/pets gets too far behind the player, they just auto teleport next to the player's location.

Kivy MapView offline

I'm planning to write a Kivy app containing a (small) offline map. Kivy's Mapview widget seems to be a good choice to display maps but before I start diving into it further one question that I couldn't figure out: Is it possible to use Mapview offline, by using locally stored tiles?
I managed to do it, it turns out it is not that complicated to do but it took some research (at least for a beginner like me). Here is a rough outline:
1. MapView supports mbtiles as source as detailed in the documentation - mbtiles can be created in TileMill
2. I wanted a map in Openstreetmap style, so I downloaded openstreetmap-carto from github. The installation manual explains quite well what needs to be done in order to obtain a map in this style
4. There the biggest challenge was to set up and manipulate a PostGIS database. This link helped: http://www.bostongis.com/PrinterFriendly.aspx?content_name=loading_osm_postgis
There were some additional issues along the way but all could be solved by combing through the internet.

Xamarin - tutorials reference missing identifier field

I downloaded Xamarin a few days ago and started going through the tutorials but i cannot even complete a relatively simple tutorial
Xamarin Tutorial
I get to step "Create the UI" where on the StoryBoards it starts referring to an field called "Identifier" - i can not find this. Some posts i found on Stackoverflow suggest that this is now called Storyboard ID? However storyboard ID is not available on all objects. StoryboardID is only available for Controllers, in this specific tutorial it is trying to set a Table View Cell identifier (!??????).
The tutorial becomes completely useless then even from a basic understanding point of view because these IDs are used later on in the C# code.
I am almost certain that this problem is because of Xcode version changes between 4 and 5 or something however its incredibly frustrating for someone new to Xamarin when going through the basic tutorials that they don't make any sense when it relates to Xcode ):
If anyone could shed some light on this it would be great.
Thanks.
You should set Identifier for Table View Cell. In the tutorial on the image you may notice that cell is selected. And also in the tutorial written that you should set Identifier to retrieve instances of UITableViewCell, not for StoryBoard.

Make Spheres on a Canvas3D 'clickable'

I've got a Canvas3D which holds a couple Spheres. Is there a way to detect when the user clicks on a sphere?
In Java3D this is known as "Picking" you should read the section on the Java3D API Tutorial if you haven't already. Here is the section on Interacting with objects, you're looking for page 35 by the way:
http://java.sun.com/developer/onlineTraining/java3d/j3d_tutorial_ch4.pdf
Heres the entire tutorial:
http://java.sun.com/developer/onlineTraining/java3d/
Hopefully this answer didn't come too late! I just started Java3D myself, hope this helped!

Resources