The error 4MOT/4/40000003:HDD-1244 is a HD fan error. You'll likely need to replace the fan unit and you also may need to replace the HD as it maybe also overheating as well.
Given the fact you are doing 3D work on this older system maybe a lot to do with it.
You stated it's only when you are doing 3D work the temp goes up to 90c and thats when you get the error and when the screen gets dark.
Part of the problem is when you do 3D modeling, CAD, image processing or video editing you need a lot or RAM. So when you have a system which does not offer it the system reaches out to the HD using virtual RAM for Cache or Paging (depending on the OS and App.) This can over stress a drive and in the process create a lot of heat. When the system encounters a point when the heat is to great it shuts down the display and will also give you an AHT error like what you've gotten.
Basically, the system overheated and the fan ramped up to its max but it was still too little given the amount of heat it had to deal with.
OK what to do here??
To start with you should replace the fan as its likely getting close to wearing out and it maybe unable to get to the max output. But lets look a bit deeper than the fan error...
If you have an i5 or i7 model then I would recommend maxing out the RAM to 16 or better yet 32 GB! You'll first need to make sure the systems firmware is up to date following this Apple T/N: About EFI and SMC firmware updates for Intel-based Mac computers.
Next I would either replace the HD with a SSD or better yet add in a second drive (SSD) replacing your optical drive with a 2.5" drive carrier. Here's the IFIXT guide for doing this: Installing iMac Intel 27" EMC 2309 and 2374 Dual Hard Drive. I would go with a 512 GB unit and make it your boot drive with your apps. You'll need a drive that supports SATA II (3.0 Gb/s) like this one: Samsung SSD 850 EVO. Note the Interface line clearly states SATA 6Gb/s (compatible with SATA 3Gb/s and SATA 1.5Gb/s) Make sure the drive you do get states it supports SATA II (3.0 Gb/s) otherwise look for a different drive. Note if you go with replacing your HD with a SSD you'll likely need a much bigger SSD which will be costly! Which is why a dual setup is better.
Then we'll leave the HD as your data drive. You may also want to upgrade it as well going with a 3.5" SSHD like this one: Seagate FireCuda SSHD again note the spec sheet call out SATA Transfer Rates Supported (Gb/s) with 6.0/3.0/1.5 listed. Here is the IFIXIT guide you'll need to follow: Mac Intel 27" EMC 2309 and 2374 Hard Drive Replacement and you'll need to get this: OWC In-line Digital Thermal Sensor for iMac 2009-2010 Hard Drive Upgrade to replace the needed thermal sensor the system requires to manage its heat (SMC). Remember your HD was cooking so its likely getting to the point of failure which is why I would replace it sooner Vs later.
Now the rub! While the i Series system is worth the investment the Duo Core models are not. You also have Apples constant dropping of support on the older systems so Sierra will be the last for this model as it stands now. So newer Apps may not work as they may require newer code in the OS to work.
Lastly, if you are planning on doing a lot of 3D modeling or any heavy graphics I would recommend getting a newer system which has a better processor. Maybe a 27" i7 2011 model or the newer 27" 5k model.