You will need more than quaternions to get a rotating cube working without OpenGL. You would need some kind of basic lighting for this to work.
If you really want to build a 3d engine from scratch without OpenGL, I suggest checking this book out. It was written in the mid 90s and explains how to write a simple 3d engine in DOS.
If you really want to build a 3d engine from scratch without OpenGL, I suggest checking this book out. It was written in the mid 90s and explains how to write a simple 3d engine in DOS.
https://archive.org/details/BlackArt3DEBook