Wednesday, 8 June 2016

Source Example 2 - Scene Picking & Targets

Moving on from example 1 but sticking with the Model and Scene class, this example shows how to apply picking objects from the scene and also how to apply a targeting reticle to a model using the Get2DCoors method.

For this to be done I have added the RandomchaosContentPipelineManager to the project, this gives the model class the ability to use the bounding box data.

You will see in the example screen above that the target reticle is not in the center of the model, this is because the skullocc.x file has it's center at the bottom of the model. I have also noticed a bug with the targeting code, if you target a model then rotate the camera 180 degrees away, you get the target reticle behind you.

Again to ensure the download works, you will have to reference the Randomchaos3Engine.dll and the RandomchaosContentPipelineManager.dll, the later is done by right clicking the project name in the project explorer, select properties, select the Content Pipeline tab remove the current setting and replace with the path you have for the dll on your system.

If you have any comments or issues with this example, please post them here :)


  1. Hello Charles, I can't seem to access the source code to this sample. Can you provide it. I would greatly appreciate it. Thank you for creating such an awesome sample.

    1. Hi Jordon, yea, a lot of the posts will have broken links like this, as and when you find them let me know and I will fix them. I have all the source zips on my server so it's just a matter of me linking them up. There are so many posts I only do the ones people ask for.

      I see you have requested other, zips too, I should have them all fixed in an hour or two :)