Hello Guest

Author Topic: 3D object for tk2dCamera  (Read 5663 times)

xikky

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 20
    • View Profile
3D object for tk2dCamera
« on: February 26, 2013, 04:15:05 pm »
Am I wrong if I still use 3D objects such as cubes, spheres, cloths, etc. in front of tk2dCameras? Should I be better of if I use Unity's camera?

I'm trying to use tk2dCameras to gain from their advantage of resolution overrides and GUI, but I wish to know which is better video and performance wise.

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: 3D object for tk2dCamera
« Reply #1 on: February 26, 2013, 04:28:09 pm »
Performance wise, there should be no difference, but the tk2dCamera is orthographic - if you have 3d objects, you might want a perspective camera. The resolution overrides make a lot more sense in 2d than in 3d... with 3D you don't really aim to map pixel perfect graphics.


WHat is it you want to do with the 3d stuff?

xikky

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 20
    • View Profile
Re: 3D object for tk2dCamera
« Reply #2 on: February 27, 2013, 10:44:29 am »
I'm doing a kind of a pin pong game, where the player is at the bottom, keeping the ball from falling. I absolutely need some of the 'Side walls' to be in 3D. I also made the player and the ball 3D objects with rigidbody to behave under physics. All the rest will be in 2D, like particle emitters, collecting objects, etc.

I don't want to show any object in 3D so I don't need the camera set to perspective. I need orthographic purposely, to show the 3D objects in 2D.

I just thought, what if tk2dCamera was optimized for sprites and planes and not 3D objects? would I'd be better off with Unity's Camera?

I would rather use tk2dCamera though, to display other 2D objects in the game in pixel perfect.

And would resolution overrides work well in this case with all objects? (If I understand well resoultion overrides is used for letterboxing, am I right?)
« Last Edit: February 27, 2013, 10:52:10 am by xikky »

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: 3D object for tk2dCamera
« Reply #3 on: February 27, 2013, 11:08:19 am »
Why not use 2 cameras, one perspective for 3d, and a second ortho tk2dCamera for all your 2d/UI stuff? You can easily mix and match.

xikky

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 20
    • View Profile
Re: 3D object for tk2dCamera
« Reply #4 on: February 27, 2013, 12:15:57 pm »
I don't know how to exactly. But thanks for the help I will try this, it seems nicer.

Will letterboxing still be applied well when using 2 cameras like you mentioned?
« Last Edit: February 27, 2013, 12:46:27 pm by xikky »

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: 3D object for tk2dCamera
« Reply #5 on: February 27, 2013, 12:49:58 pm »
Letterboxing won't work automatically on a perspective camera, just the ortho cam, but you could adjust parameters to suit.

Check out sample #6 in tk2d, 2 cameras mixed there. Not tk2dCamera, but a perspective and ortho. Same principle applies to tk2dCamera.

xikky

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 20
    • View Profile
Re: 3D object for tk2dCamera
« Reply #6 on: February 27, 2013, 03:54:40 pm »
Then I think best would be to use tk2DCamera, as I think that it behaves many similar to an Unity ortho Camera, and as I need letterboxing. This way would make it easier. Moreover, on this http://forum.unity3d.com/threads/26596-Orthographic-always-better-for-2D post, it is mentioned that ortho would be better for a 2D Game. Becuase perpective cam may differ a tiny little bit the performance due to perspective transformations, and I have no problems for Parallex Scrolling.