7

I'm creating a 3D space game using Ogre3D for graphics with C++ and one of the features is to be able to freely wander around spaceship interiors, but I am lost with how to implement it. Here is what I can think of so far:

  • A single model of the spaceship that has an interior modelled too, but somehow double-sided and double-normalled? Not sure if this is possible!
  • Two models, one of the spaceship outside and one of the interior with flipped normals, when in game the interior model is placed inside the spaceship mesh, but that wouldn't be very flexible (different spaceship sizes, hull thickness etc)
  • Two models, when a player enters the space ship the screen fades and their view is switched to the inside model where the windows are live render textures of their respective place on the outside part of the spaceship, but it wouldn't be very optimised (rendering to several textures) and wouldn't have the gameplay aesthetic of smoothly entering or exiting (possibly via explosion) the ship

So, GameDev, how would you approach this?

toficofi
  • 657
  • 7
  • 13
  • 2
    Can you explain more about how you want to implement this? Can the player seamlessly exit the ship? If the door/hatch is open, can they see the exterior and the interior? – House Jan 22 '13 at 19:25
  • 1
    That's the question, Byte56, I'd like to have the player seamlessly exit and enter the ship but it depends on the type of implementation. – toficofi Jan 22 '13 at 19:47
  • 2
    How big is the ship? When you say one or two models, do you mean one or two meshes? I'd imagine you'd have to use many meshes to build a ship of some size. Unless you're talking about a pod. –  Jan 22 '13 at 20:26
  • 1
    There are many ships, of different sizes, ranging from little pods to giant cruisers, but by models I mean the overall shape of the ship, whether that be the inside shape or the outside shape. If that makes any sense. @Erik – toficofi Jan 22 '13 at 20:41
  • StarQuest Online has this already. –  Apr 03 '13 at 14:45
  • As long as airlocks and other openings line up between inside and outside and between rooms, you can make interiors from as many different meshes as you like. Might as well make the player able to customize the interior and exterior by building the ship from different tiles/part (this would have the side effect of making asset creation easier, most parts could be reused for different ships). Just need to make sure the interior doesn't penetrate the exterior. Slightly related: http://gamedev.stackexchange.com/questions/47917/procedural-house-with-rooms-generator – Exilyth Jun 17 '13 at 21:17

1 Answers1

13

The first option is what I would use. One model for everything. It's totally possible to have an interior and exterior of a model. Just like it's possible to have concave shapes. There's no double normals or double sided faces. Imagine a slice out of a crappy ship like this:

enter image description here

(I have no idea why the floor isn't flat, I only realized that after I posted it...)

Black lines are faces, red lines are normals. The surfaces wrap around. This allows you to have different hull thicknesses, blocking off interiors where the engines are, stuff like that. The doors are easy to place as separate parts (since you'll probably want to be able to move them anyway).

House
  • 73,224
  • 17
  • 184
  • 273