。
The submarine's periscope was sticking straight up out of the water.
Literal
Submarine [genitive-の] periscope [subject-が] water-inside [from-から] abruptly was-sticking-out.
A vivid visual moment. にょっきり is a 擬態語 (state mimetic) for something long and slender sticking up or out suddenly and prominently — often with a slightly surprising or comical nuance. Classic collocations: にょっきり生える (sprout up), にょっきり顔を出す (pop out). The image is of something vertical and unexpected emerging into view. 突き出る is the intransitive version of 突き出す ('stick out'), here in the progressive/resultative form 突き出ていた ('was sticking out' as observed state). Note the ていた (past progressive) conveys the observation point of view: the periscope was already in that state when the speaker saw it.