It is a bit more complicated than that. The 3.4 liter engine in the Tacoma is an in-line engine, meaning that when it sits in the engine bay, the cylinders are lined up in the same direction that the vehicle is pointed. This is the usual way that most rear or 4-wheel drive vehicles have their engines for the best "packaging" and transmission of power to the transmission and wheels.
The Solara uses a transverse engine configuration which is most common on front-wheel drive and all-wheel drive cars and vehicles. This gives better packaging and room for passengers along with the transmission in this type of vehicle.
What I'm trying to say is that given an unlimited amount of time, money and technical know-how, you can put any engine into any vehicle. However, in this case, it probably isn't practical with the amount of engineering required to do so.
Hope this helps.
15yrs of working with Toyota's