Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Author
Message
TheViking
14
Years of Service
User Offline
Joined: 16th Feb 2012
Location:
Posted: 28th Nov 2014 05:17 Edited at: 28th Nov 2014 05:18
ok, I'm back again, with yet another camera issue. I got the second camera working ALMOST the way I want... however, when my main character rotates, (obj 1), object 4 rotates the same to keep it at the same distance and positioning. this works fine, but when I apply the second camera set to be at a set distance and angle on object 4, it doesn't rotate the same when the rest rotates. Sorry, I don't know how else to explain it. If you need me to explain it in another way, please let me know. Below is a small portion of the code which controls the camera position for the second cam. Can anyone see something that would cause this issue? Thanks, as always.


This is how I set my second camera is set on object 4.


EDIT:
Oops, I didn't realize my old post about this similar topic was still on page one... sorry... kinda a new issue I guess though.
Sasuke
20
Years of Service
User Offline
Joined: 2nd Dec 2005
Location: Milton Keynes UK
Posted: 28th Nov 2014 14:35
Out of interests, do you rotate other things using XYZRotate commands and Pitch/Yaw/Roll commands combined, like you have for camera 1 here? Reason I ask is there two different types of rotations that don't work well together

Also your explanation is a tiny bit difficult to follow. Maybe instead say what you want to achieve, might be easier to work out what your trying to do

"Get in the Van!" - Van B
TheViking
14
Years of Service
User Offline
Joined: 16th Feb 2012
Location:
Posted: 29th Nov 2014 00:57 Edited at: 29th Nov 2014 01:01
Yeah, in the main block of the controls, I use rotate object xyz for the main character, the weapons and others. However I use YRotate for the main in game camera.

I guess to explain better, I'll use a few pictures.

So... there are two maps currently for the level, will be more eventually. The first object is the main level, while the second is a "battle map" which when you go into battle, it hides the main world map, and shows the "battle map" To keep the main character facing the same direction after the battle resolves, I instead have rotated the "battle map" to the same rotation as the main character.

As you move, the battle map follows your exact location/rotation, as do the enemy positions (which are hidden) and become visible only on entry to a fight.

This is the main map.



Nothing is wrong with this, the battle map is hidden from view and is rotated so each occurrence he is facing the same direction and in the same spot on the battle map (ie: Final Fantasy style battles)

Now, when he enters a battle I have a splitscreen cutsceen which pans around him with one camera (the one on the left) and then the camera on the right is fixed pointing at the enemy. Like so:




In comes issue:
Each do their little animation thingy. This is fine AS LONG AS in the world map the main character is facing EXACTLY in this angle. If he rotates even so slightly the camera on the right (fixed on enemy) will be thrown off by an unknown degree and you will see something like this:



A beautifully untextured portion of the battle map. Ignore the extra black line between the split screen... it's just the back faces of another object.

ALSO, don't mind the quality, it does look nicer than this, I just lowered it and cropped it a bit to save on space...

What I want is to be able to have the camera fixed at this same location on the enemy each time you enter the fight.

I hope this is a little better of an explanation and helps with understanding the issue better.
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 29th Nov 2014 12:33
Is the second camera supposed to be simply a close up view of the main camera? If so then a fix should be simple.



Powered by Free Banners
TheViking
14
Years of Service
User Offline
Joined: 16th Feb 2012
Location:
Posted: 29th Nov 2014 17:14
Ah, no... I feared that picture would give that look... What happens is the camera on the right stays at that position, while the camera on the left pans around the guy... The camera on the right will not always be in this location and may do some panning eventually with future cutscenes. In that image it looks like its just a close up, so I'll attach an image a few seconds later than that one was.

Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 30th Nov 2014 00:57
How are you rotating the second camera? You could simply rotate it in a circle around the desired object and point it at the object. Something like the following, perhaps? Or have I misunderstood what you're trying to do?





Powered by Free Banners
TheViking
14
Years of Service
User Offline
Joined: 16th Feb 2012
Location:
Posted: 30th Nov 2014 01:17 Edited at: 30th Nov 2014 01:22
Hey GG,

Yeah, the second camera is not meant to rotate around the object during the scene. It`s meant to be fixed at a certain location pointing at the object. However, the object does rotate in the world prior to the cutscene. So, I`m trying to keep the camera pointing at this same location with the same angle if the object rotates outside the cutscene. I`ll try a little harder to bullt out some code to show more of the program. But not use the real code... as it's a little lengthy. If the full code would help, let me know.




The portion I am having trouble with is because outside the battle map, object 3 rotates at the same angle as object 1, and is offset the same, as soon as you rotate even the slightest in the world map, the second camera is thrown off from it's position and where it points
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 30th Nov 2014 12:01
Quote: "So, I`m trying to keep the camera pointing at this same location with the same angle if the object rotates outside the cutscene. I`ll try a little harder to bullt out some code to show more of the program."


Still not sure what you mean, i.e. "the same angle" as what? The same as it was before or the same as the other camera. What code do you use for positioning and rotating the two cameras?



Powered by Free Banners
TheViking
14
Years of Service
User Offline
Joined: 16th Feb 2012
Location:
Posted: 30th Nov 2014 15:52 Edited at: 30th Nov 2014 16:01
Ok, guess I'll just have to post a good chunk of the code here to make it simpler.

Rotation in the world map:



Randomize the number of enemies and type of battle:


The Camera Setup and enemy setup for the fight. It Controls the positioning, rotation and pointing of camera 2 at the enemy. Something in here is where the problem lies with the rotation. being off by a few degrees from what the enemy's rotation is.



And Finally: The portion which switches on the second camera and pans the first camera


Hope this helps... I really have to get better at explaining things. WOW, love how copy and paste jumbles the indents.
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 30th Nov 2014 16:09
I'd think carefully about what these two lines are supposed to be doing. Since you've told the camera to point at it's new position what direction would you expect it to be looking? I have no idea. I'd start by eliminating uncertainties like that to make the code more predictable.





Powered by Free Banners
TheViking
14
Years of Service
User Offline
Joined: 16th Feb 2012
Location:
Posted: 30th Nov 2014 16:36 Edited at: 30th Nov 2014 17:25
I've tried replacing the Point Camera to YRotate to Object angle 4, then move the camera away and point, but it still yields the same result as well. I've been trying to fiddle with that portion since I found this issue... tried many things, but just can't bring my mind to see what it is...

I'll keep plucking at it though... haven't given up on it yet...

I would have thought that positioning camera to object 4, YRotate camera to object 4 angle and moving back would give a straight view of it... but it doesn't seem to... and if it does, the next time it will be set differently..
TheViking
14
Years of Service
User Offline
Joined: 16th Feb 2012
Location:
Posted: 7th Dec 2014 22:55
Just as a follow up.... Sasuke was right... I found a few commands in there where I mixed the rotate XYZ and YRotate... Changing them all to Rotate XYZ fixed the problem... DOH! Thanks!!!!

Login to post a reply

Server time is: 2026-07-06 17:12:06
Your offset time is: 2026-07-06 17:12:06