|
Post by jaypickle on Apr 6, 2016 18:27:02 GMT
Hello,
I was wondering if someone might be able to tell me how to handle the cameras starting position.
I'm creating a 2 player game where each player starts on opposite ends of the map. I would like to set it up so that player 1 looks south - north (the default rotation) and player 2 looks north - south (rotating the camera 180 degrees on the global Y-axis). Like the way it is done with Hearthstone.
However, when I do this all my trees disappear, could you tell me how to fix this or point me to the code where the orientation of the trees is set up.
Thank you for any assistance!
-JayPickle
|
|
|
Post by khash_remote on Apr 7, 2016 22:51:42 GMT
hi
trees are bundled in batches facing certain angle. There is something like foreground factory.
the best solution i could suggest is to create two sets of meshes, one for each player facing different angle and on different rendering layer
|
|
|
Post by jaypickle on Apr 8, 2016 9:01:23 GMT
Hi Khash,
Thanks for the reply. I got it figured out, in case anyone else asks. I got the foreground to always face the camera by changing the BuildForeground method in ForgoundFactory.cs to just use the Camera's rotation.
static public Mesh BuildForeground(Chunk chunk, UFTAtlasMetadata atlas, float viewAngle, Vector3 worldPosition) { //build mesh using sorted chunk data MeshPreparationData mpd = new MeshPreparationData(); //don't create the qAngle with the paramater //Quaternion qAngle = Quaternion.Euler(viewAngle, 0.0f, 0.0f);
//just use the cameras rotation qAngle = Camera.main.transform.rotation;
<...etc...> }
|
|
|
Post by matongnguyenchat on May 16, 2016 16:50:15 GMT
<a href="http://cordibee.com/mat-ong-chanh-dao-ngam-duong-phen-380ml"> mật ong chanh đào</a> <a href="http://cordibee.com/mat-ong-chanh-dao-ngam-duong-phen-380ml">chanh đào</a>
|
|
|
Post by matongnguyenchat on May 16, 2016 16:52:31 GMT
|
|
|
Post by khash on May 23, 2016 12:22:46 GMT
" by changing the BuildForeground method in ForgoundFactory.cs to just use the Camera's rotation."
I think trees might flip now due to the camera movements which most likely would be noticible ;/
|
|