Search the Community
Showing results for tags 'Camera'.
-
I'm making a first-person shooter and I want two cameras to work for me. The first - rendered the environment, and the second - hands with weapons. But I ran into a problem - Unigine shows the render only from the camera that has the Main Player check mark and ignores all other cameras. An attempt to set the Main Player check mark on two or more cameras only led to the fact that Unigine took the render of the lowest camera in the hierarchy, also ignoring all the others. How can I combine a render from two cameras?
-
Ошибка работы камеры PlayerPersecutor при попытке запустить трек
ilya.saitov posted a topic in Animation
Хочу сделать трек с облетом камеры вокруг объекта на воде с использованием PlayerPersecutor. Посмотрел обучающее видео как сделать Track, изучил пример Tracker из csharp_component_samples. Задумка удалась, обрадовался я. И решил заняться настройками графики сцены, буквально сделал пару переключений между шаблонами пресетов, вернул как было и при запуске сцены я наблюдаю такую картину: Подумал, наверное сбились какие то настройки. Потыкал, решил выйти из сцены без сохранения, зашел обратно - не помогло. Решил проверить трек - в редакторе работает все идеально. Запускаю - снова та же картина. Решил пересоздать ноды на сцене, все удалил, добавил обратно - не помогло. Решил проверить с другой камерой - PlayerDummy. Запускаю и все работает! Наверное дело в настройках камеры. Смотрю, а у меня TargetNode нулевой стоит. Выставил, запустил - та же картина. Перезагружаю сцену в редакторе - TargetNode у PlayerPersecutor пустой снова. Пробую повторить ошибку - запускаю программу, вижу картину на скриншоте, перезагружаю сцену - TargetNode пустой. Вывод: у PlayerPersecutor "отлетает" TargetNode при попытке запустить трек с PlayerPersecutor. Но вот проблема, почему у меня до этого все получалось и все было нормально, а после того, как я покопался в настройках, начались глюки с PlayerPersecutor. Причем больше скажу, даже если я не запускаю трек, а только лишь в сцене имеется компонент с Tracker.cs (из примера Tracker из csharp_component_samples), то все равно у PlayerPersecutor "отлетает" TargetNode. Пробовал создавать пустой проект и повторил данную ошибку на кубиках. В общем на данный момент остался без PlayerPersecutor, а он мне он очень нужен для моей сцены. Только если свой писать... p.s. код вообще не трогал, сделал 1 в 1 как в примере. -
I am using Unigine 2.15.0.1 I noticed a bug in the display of the frustum in the editor for physically-based camera. Frustum is displayed correctly when using vertical mode (see vertical.png). Screenshots below display the same camera set using both modes. Both modes give the same accurate screenshot using Tools->Video Grabber. In physically-based mode focal length and film gate are set in pixels as unit and not in mm but it shouldn't matter since it's used as a ratio to compute FoV. I am guessing the mistake is an inversion of width and height to display frustum because in physically based mode the FoV is computed horizontally whereas in vertical mode it's.. vertical FoV. When I put 1080 in film gate I get a correct frustum but an incorrect screenshot (see physically_based_vertical_filmgate.png)
-
Is there a built in tool for camera shake or it should be done manually in script?
-
I'm new to Unigine so might be missing something obvious here. I'm having trouble importing an animated camera from Max. I've baked the animation and exported the .fbx file which works fine when imported back into Max. The camera imports fine into Unigine but no animation. Any suggestions?
-
Hello, I just started learning Unigine and have a question about importing an animated camera. I have tracked some drone footage in Blender and want to use the camera data in Unigine. Is there any way to import the camera transformation into tracker (using fbx or other method)?
-
Hi. I have a third-person character made by PlayerPersecutor. When target node moves in world my camera turns for it and changes distance. setFixed function freezes angle in parent coordinate system. How do i can freeze Phi angle of Player in world coordinates? Thank you.
-
I want to move an object to fill the screen. Similar to Move to camera in the editor. How should I implement it? Please help me
-
Hello. Is there some way to produce high-aspect picture (reso like 20000x800) without distortion on one screen? So, i need something like render_panorama but cameras should stand in a row, look the same world direction and don't have distortions on the seams. It's for a video CG production, not sim/game, so performance doesnt matter at all. Thanx.
-
Hello everyone, I`m having a bit of a problem setting up a proper orthographic camera with C++ API in my projects. It seems that there is no way for me to change a camera projection without creating my own mat4 and passing it as an argument to setProjection to the class camera. Is there any other way around to acomplish this task without going in depth with matrix conversations?
-
Hello simple example where roll are not applyed to camera rotation in unigine script Player P; P = engine.game.getPlayer(); P.setWorldRotation( P.getWorldRotation()* ( //quat(rotateX(5))//pitch - ok //quat(rotateY(5))//yaw - ok quat(rotateZ(5))//roll? not working ) ); what wrong here? how to make camera rolling?
-
hi , i'm studying for Unigine. i have a problem. I saw sample ' actor01' and i knew playeractor is need to move physics playermoving. playeractor works when playeractor pivot is appeared in my camera. However, playeractor pivot is not in my camera , playeractor doesn't work. please help me how can i solve it.
- 3 replies
-
- playeractor
- physics
-
(and 1 more)
Tagged with:
-
I have a PlayerPersecutor camera linked to animating geometry traveling along a spline. When viewing the animation through the Editor camera the animation runs as smooth as a baby's bum but when viewing through the PlayerPersicutor camera there's terrible jittering going on. Any ideas what the problem could be?
-
Hi, I'm implementing a custom camera editor where camera position/rotation keys are placed on terrain and the info fed into a track file which then is run by tracker to preview the path. I expect/want the camera to rotate smoothly around one axis, keeping the view steady while moving from one key to the next. Issue is that at times the camera is doing an awkward rotation, tumbling down to look at the ground, rotating and then turning back up to rest on the final key. Is there a way to control this behaviour? Note: Path is in 3D so rotation can occur in all 3 axes.
-
I'm noticing a memory leak every time I make a call to several of the new Viewport::render* calls. These are the functions I've tested and experienced the issue with: void render (Camera camera) void renderImage2D (Camera camera, Image image) void renderImage2D (Camera camera, Image image, int width, int height, int hdr = 0) More details: My application creates a Unigine-Qt window (subclasses Unigine::App), then creates additional rendering windows to show other views (much like the old RenderQt sample which no longer appears to be part of 2.2.1). Each view is updated continuously during the run loop, so every time a paint event is requested, Viewport::render is called (once per additional window). I've recreated the issue by porting the old RenderQt example to 2.2.1 (attached). I've narrowed the leak down to the single Viewport::render call -- with this line in, the program leaks, but when this line is commented, no memory is leaked. I'm building in release/x64/single precision on Windows. Am I forgetting something in order to prevent such leaking? Even more details: In my program (which uses 6 external 1280x800 windows for rendering to projectors), the leak happens rapidly. I assume because I'm rendering fairly large textures (1280x800 x 6), Unigine quickly reaches 15-20+ GB of RAM, then crashes. What's strange is that I only notice this rapid leaking when the Unigine::App is minimized (perhaps because drawing happens faster when the the app is minimized, leading to more rapid Viewport::render calls?). However, in the attached example, I'm noticing leaking no matter if the main app is shown or minimized. Thanks for your help! Kevin RenderQt-viewport.zip
-
I'm performing a simple mouse intersection test to create a new dummy node and whenever I do, my editor cam is reset somewhere back to 0,0,0. Any idea why this is? int ret[1]; vec3 p0, p1; Unigine::getPlayerMouseDirection(p0,p1); Object obj = engine.world.getIntersection(p0, p1, ~0, ret); NodeDummy pt = new NodeDummy(); pt.setName("TESTNODE"); pt.setWorldPosition(ret[0]); engine.editor.addNode(pt); Philip
-
Hi folks! I'm currently facing a rather annoying issue in Unigine, created by myself and my lack of understanding of course, which I need your help on! My situation is this: I have two characters, I want to calculate the mid-point between these two characters' heads and make a camera inside of the game look at that mid-point. What I am currently doing is: 1. Cycling through bones and finding the head bones of each character 2. Using ObjectMeshSkinned::getWorldBoneTransform to get the transform of each head bone as a mat4 3. Getting the 12th, 13th and 14th values from the head bone mat4s that represent the position of the head bones 4. Creating two separate vec3s for each head bone position using the values from stage 3 5. Finding the distance between the two values and normalising them to give me a look direction for my camera 6. Using Node::setDirection to set the direction the camera is facing like in the default setup of: camera = new PlayerSpectator(); camera.setDirection(Vec3(-1.0f, 0.0f, -0.5f)); The script I am using to get the PlayerSpectator from the world is: PlayerSpectator camera_Player = node_cast(engine.world.getnode(0123456789)); My problem is: When I try to do anything PlayerSpectator/Player/Node related with the PlayerSpectator variable I get an error saying: Project001/Project001.cpp: 1092: ExternClass::run_function(): can't find "class PlayerSpectator * __ptr64" base class in "class PlayerDummy" * __ptr64" class Can anyone suggest what I am doing wrong? Should I not node_cast cameras or something? Am I referencing them the wrong way? I can't even call Node::getNodeName or anything! Thanks in advance for your help! Tom
-
Hello, I'm currently attempting to build a prototype entirely using the C++ API. Right now I'm transferring camera control from UnigineScript into C++. Placing the camera (player) was working fine in UnigineScript, but in C++ it hasn't been going well. I'm running into a problem when using the command: player->setTransform(setTo(UNIGINE_VEC3(0.0, 0.0, 20.0), UNIGINE_VEC3(0.0, 1.0, -1.0), vec3(0.0, 0.0, 1.0))); The second parameter is supposed to control the direction of the camera/player. However, my player points in the -z direction no matter how I change it. Even if I switch the argument to UNIGINE_VEC3(0.0, 1.0, 1.0), the camera points in the -z direction. I've tried many different numbers as well as changing my argument to a unit vector, but the camera always points straight down towards -z. Is this an error with the C++ API or am I doing something else wrong? Thanks!
-
In a 3D match-moving tool, I can create and animate a camera (the tool analyses the footage to derive the 3D position/rotation of the "real world" camera). Then export the animated camera in an FBX file. But I cannot see how to save the animation of the camera for later re-play. Am I missing something simple? I can see the camera animating correctly by sliding the FBX importer "Time" control but there are no files saved by the importer.
-
Usually I use wasd to get around my scenes because it feels the most natural, but in Unigine the wasd controls are painfully slow. Even while holding shift, I feel like I'm moving an inch an hour. I heard someone say that the speed is different per world file. Is there a setting to speed the camera movement up?
-
[SOLVED] Examples on Player.setUp or setModelview to "roll" the camera (psi angle)
koshman86 posted a topic in General
Hello, I'm having troubles with setting the camera "roll" rotation (like a spinning airplane), or (it's equivalent) setting arbitrary camera Up direction. Are there any examples on it? The problem is, I made a camera flying round the Earth, and I set direction of radius-vector as Up direction using PlayerSpectator.setUp(). Camera is moved by (camera)Node.setPosition(). At certain positions (e.g. 1000;0;1000), I get camera suddenly "reversing" backwards, and if I keep pressing "forward" it reverses again, and again, so moving like stairsteps (shifting slowly up or down). As I found, there appears some exchange of x<->z coordinates of camera. I tried to catch the change, and it seems to happen outside my code. When I remove setUp(), the "reversing" vanishes. I also tried to use PlayerSpectator.setModelview() (seems to have no effect), and (camera)Node.setRotation() (only sets direction and fails to roll the camera). -
Привет. У меня вот какая проблема. Я привязываю камеру к PlayerActor, но мне нужно поднять ее выше, по оси Z. (Вид из головы). У меня маштаб больше единичного. Я делаю так: PlayerActor actor; PlayerPersecutor camera. init (){ .. camera.setAnchor(vec3(0.0f,0.0f,10.0f)) camera.setTarget(actor); engine.game.setPlayer(camera); .. } Так работает плохо, так как камера зарывается в землю, или блокируется на некоторых углах. Потом я делал так. PlayerActor actor; PlayerSpectator camera. init(){ .. engine.game.setPlayer(camera); .. } update(){ .. vec3 tmp = actor.getPosition(); tmp.z += 10.0f; camera.setPosition(tmp); .. } Так работает, но смотрит вниз. Если изменять Direction камера перестает работать ( actor не контролируется ). Как мне быть? Hey. I have here what the problem is. I tie the camera to PlayerActor, but I need to pick it up, along the axis Z. (View from the head). I have more than a single scale. I do so: PlayerActor actor; PlayerPersecutor camera. init () { .. camera.setAnchor (vec3 (0.0f, 0.0f, 10.0f)) camera.setTarget (actor); engine.game.setPlayer (camera); .. } This is how bad, because the camera burrows into the ground, or is blocked in some corners. Then I did so. PlayerActor actor; PlayerSpectator camera. init () { .. engine.game.setPlayer (camera); .. } update () { .. vec3 tmp = actor.getPosition (); tmp.z + = 10.0f; camera.setPosition (tmp); .. } So works, but looking down. If you change the camera stops working Direction (actor is not controlled). How can I be?
-
In the docs, the camera referred to as third-person. How do we spawn/initialize FPS cam in Unigine and control it? How do we set collisions for it and a make it sway as in typical FPS game? Thank you. EDIT: http://i.imgur.com/MCnbA.jpg << I need to achieve #3. This way I have shadows cast by the player's model, I see player in the reflection, for I only see vweap model (arms and guns) in the view. That's how pretty much most FPS games work.