Jump to content

Isometric like view


photo

Recommended Posts

Im developing a simple prototype in my free time to get familiar with unigine, what I want to implement is some basic isometric view, similar to Oil rush view, but with a small difference: in Oil rush the camera rotates over itself (looking "around"), in my prototype I want to rotate it around the center of the visible area. My previous experience in Ogre3d was to create a target node, which is translated and rotated to simulate scroll and rotation, make camera node track the target and set projection to ortho mode. I checked the Oil rush code and found that the camera is a PlayerSpectator, but couldnt find where it is handled. Can somebody give me a direction here?

Link to comment

Hmm, tried that, using a dummy node, but perhaps I didnt went deep enough to make it work. Does target rotations affect the camera too?

 

Have a look into provided UNIGINE sample code data\samples\players\persecutor_00\01.cpp as a working starting point. PlayerPersecutors Phi/Theta angles seems to be relative to target node world coordinate system after target node Z-axis rotation. Target node X-/Y-axis rotations do not seem to influence PlayerPersecutor attitude.

 

For your described use case simplest approach would be to place dummy node without any world rotation to the desired orbiting center and use PlayerPersectutor.setPhiAngle()/.setThetaAngle()/.setDistance() to position PlayerSpectator relative to this world pivot point.

Link to comment

Also, maybe this trick can be useful:

PlayerDummy camera = new PlayerDummy();

mat4 look = ::lookAt(sourceVector, destVector, directionVector);

camera.setModelview(look); // orient camera to lookAt matrix

Link to comment
×
×
  • Create New...