Please login or register.

Login with username, password and session length
Advanced search  

News:

IRC channel - server: waelisch.de  channel: #wme (read more)

Pages: [1] 2  All

Author Topic: Wide scenes and 3D actors  (Read 10341 times)

0 Members and 1 Guest are viewing this topic.

adonf

  • Regular poster
  • ***
  • Karma: 0
  • Offline Offline
  • Posts: 124
    • View Profile
Wide scenes and 3D actors
« on: October 27, 2006, 02:44:18 PM »

Hi,

We're trying to use scenes that are wider than the screen (We want the scene to scroll as the actor goes left or right. They do this a lot in Runaway, it makes the scenes seem less static.). This seems to work well with 2D actors but we have 3D actors and we're having trouble with the 3DS file. In the scene editor and in-game, the 3DS model is squeezed into the first physical screen : our game runs in 1024x768, the scene is 2048x768 and the 3DS model fills a 1024x768 area at the left of the scene.

I tried changing the camera's FOV and I managed to get correct dimensions for the 3DS model, but it is still centered in the middle of the left screen.

Is there a way to work around this ?


Thanks
Olivier

PS: we're still using WME 1.6 but I couldn't find anything related to this in the changelog for 1.7
Logged
I am the Milkman. My milk is good.

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: Wide scenes and 3D actors
« Reply #1 on: October 27, 2006, 03:11:35 PM »

If I remember correctly the camera in the 3D package should be setup so that it overviews the left part of the scene. The camera is then moved over the geometry as the scene scrolls.
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

adonf

  • Regular poster
  • ***
  • Karma: 0
  • Offline Offline
  • Posts: 124
    • View Profile
Re: Wide scenes and 3D actors
« Reply #2 on: October 30, 2006, 10:50:21 AM »

...well that can't work because if the 3D camera moves then the perspective changes and it causes a lot of problems.

I'll try anyway and let you know. Thanks for the answer.

Logged
I am the Milkman. My milk is good.

adonf

  • Regular poster
  • ***
  • Karma: 0
  • Offline Offline
  • Posts: 124
    • View Profile
Re: Wide scenes and 3D actors
« Reply #3 on: October 30, 2006, 05:18:31 PM »

Ok, it definitely doesn't work but not for the reasons I thought at first. The good thing is that the camera doesn't seem to pan or rotate so the perspective of the scene does not change. The bad thing is that it's not useable in our case, unless maybe we use orthogonal projections (not tried yet).

Let me try to explain: let's say that the scene is made of a flat, horizontal plane. In the case of a non-orthogonal projection, objects that are in front of the camera are the least deformed by the camera's perspective. If the character is standing right in front of the camera then they appear to be standing straight up. But as they move away to the right (resp. left) of the camera's axis the objects and characters will be more deformed and they will be leaning right (resp. left).

So by having the default camera overview the left part of the scene, the more the character moves to the right, the more they will lean and be deformed. This might not be too noticeable if the scene is not much wider than the screen but in our case the scene is twice as large. If the default camera was at the centre of the scene then the character would be leaning a little to the left at the extreme left part of the scene and a little to the right on the other side, which is much more acceptable and sometimes a nice effect too.

examples:
cameral set to the left


centered camera



Another problem for us is that it is extremely difficult to design the 3D scene the way you use the 3D camera. We're using 3D pre-rendered backgrounds* and we need the 3DS file to match our scene closely. If the scene is not supposed to scroll then we can use the same camera for the 3DS file and the background, that's good. But if the scene scrolls we cannot use the same camera, as the  3DS camera must overview one part of the scene and the camera used for rendering must see the whole scene. So we need to move the camera and change its field of view but still have it match the scene. I don't think that this is possible except in very simple cases.

So, Mnemonic, would it be possible in future versions to have the 3DS scene to be mapped over the main layer instead of the leftmost screen ? This way the collision and walk mesh as seen from the main camera would be matching the whole scene.

Also, I remember from a previous topic that you said people were moving away from 3D collisions, but I haven't been able to add a 3D character to a scene that doesn't have a 3DS walk file. Am I missing something ?

Filnally, has anyone else encoutered the problem I'm describing here ? If so I'd really like to hear from your experience.

Thanks for reading this far, and now I'm off to test the same scene with an orthogonal projection.

adonf.



* actually we use the pre-rendered backgrounds as a basis for hand-drawn backgrounds but the result is the same
Logged
I am the Milkman. My milk is good.

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: Wide scenes and 3D actors
« Reply #4 on: October 30, 2006, 09:19:05 PM »

Should be doable, I hope. Check your PM please :)

Also, I remember from a previous topic that you said people were moving away from 3D collisions, but I haven't been able to add a 3D character to a scene that doesn't have a 3DS walk file. Am I missing something ?
There still must be a 3D geometry file with at least a walkplane and a camera. But the blocked objects and waypoints (i.e. the most annoying part) are done in 2D.
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: Wide scenes and 3D actors
« Reply #5 on: November 05, 2006, 05:21:17 PM »

Ok, if you want, you can test this testing build, which assumes the camera overviews the entire main layer of the scene. Keep in mind this build is based on WME 1.7 beta so all the beta warnings apply here as well (you can always return back to WME 1.6 or WME 1.7 beta1 by installing the appropriate update, but scenes saved in 1.7 won't open in 1.6 anymore and will need to be manually edited).
« Last Edit: November 05, 2006, 06:11:56 PM by Mnemonic »
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

adonf

  • Regular poster
  • ***
  • Karma: 0
  • Offline Offline
  • Posts: 124
    • View Profile
Re: Wide scenes and 3D actors
« Reply #6 on: November 06, 2006, 05:26:39 PM »

That's awesome. Thank you Mnemonic for the amazing work, as always !


There's still a couple of issues but they can be corrected by hand, so it's definitely something we're going to use. Let me make some screenshot and I'll explain to you what these issues are...
Logged
I am the Milkman. My milk is good.

adonf

  • Regular poster
  • ***
  • Karma: 0
  • Offline Offline
  • Posts: 124
    • View Profile
Re: Wide scenes and 3D actors
« Reply #7 on: November 06, 2006, 06:23:26 PM »

So I made a 2048x768 render of the walk plane using the 3DS file and the main camera and put it as the background of a 2048x1024 main layer at position 0,0 (so that it would occupy the whole layer), then used the 3DS file for geometry, set the game resolution to 1024x768 in the editor and here's what I got:


(the blue box on the top left is a region that I forgot to delete)

As you can see, the 3D geometry is lower than the backgound picture and it doesn't spread all the way to the left or right.

I was able to fix it by changing the image's position and setting the camera's FOV manually. It's not perfect but it's good enough for use. Here's the resulting scene in the editor:


It looks like the camera used in the editor (blue lines) is a little higher than the one used in the renderer (grey plane), you can see that on the rightmost edge of the boat in the way the edges intersect.

So what do you think of this ? Does it look like I did something wrong or like a problem with the way the geometry is mapped to the 2D scene ?

Cheers,
 Olivier
Logged
I am the Milkman. My milk is good.

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: Wide scenes and 3D actors
« Reply #8 on: November 06, 2006, 07:28:59 PM »

Yeah, I noticed that, but I'm not really sure why it's happening. A quick&dirty solution, which I'll probably go with, would be allowing tweaking camera vertical and horizontal offset within the 2D scene.
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

leucome

  • Occasional poster
  • **
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 86
    • View Profile
    • Leucome Games
Re: Wide scenes and 3D actors
« Reply #9 on: November 07, 2006, 02:16:58 AM »

I tried it too ... Seem good ... But a wide 3d scene build with older WME not work witth it ... Maybe you can do an option to anable it only when needed ?
Logged
Look my Site ——► http://news.leucome.ca

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: Wide scenes and 3D actors
« Reply #10 on: November 07, 2006, 07:05:10 PM »

But a wide 3d scene build with older WME not work witth it ... Maybe you can do an option to anable it only when needed ?
Yes, if anyone's using scrolling 3D scenes now (and obviously someone is :)) this will be necessary.
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

adonf

  • Regular poster
  • ***
  • Karma: 0
  • Offline Offline
  • Posts: 124
    • View Profile
Re: Wide scenes and 3D actors
« Reply #11 on: November 08, 2006, 10:51:00 AM »

And if you're not using scrolling 3D scenes then as long as your main layer's size matches the screen resolution it shouldn't change anything...
Logged
I am the Milkman. My milk is good.

adonf

  • Regular poster
  • ***
  • Karma: 0
  • Offline Offline
  • Posts: 124
    • View Profile
Re: Wide scenes and 3D actors
« Reply #12 on: November 10, 2006, 04:23:28 PM »

Quote from: Mnemonic
Yeah, I noticed that, but I'm not really sure why it's happening.

I believe that FOVs in 3DS scenes are given using the camera's diagonal, but in WME you seem to use vertical FOVs. Maybe your conversion routine assumes that the screen has a 4 by 3 aspect ratio ? Just a wild guess...
Logged
I am the Milkman. My milk is good.

adonf

  • Regular poster
  • ***
  • Karma: 0
  • Offline Offline
  • Posts: 124
    • View Profile
Re: Wide scenes and 3D actors
« Reply #13 on: November 20, 2006, 03:08:56 PM »

Hi, Mnemonic

Could you let us know how you compute the projection of the 3D scene into the 3D screen and vice versa ? Knowing this would help us when we design animations that need precise interaction between the 3D actors and the 2D scene.

For the moment there is a lot of guess work when making animations. We would like to be able to see what the final animation looks like directly in MAX by setting a 2D background and using the same camera as the game uses, but the camera parameters in the game are not the same that we put in MAX before we export our 3DS scene. They're close (except in the case of scrolling 3D scenes as we said earlier), but not exactly the same.

Another problem is that the character 3D positions always match a 2D position on screen, so not all 3D positions are valid ones, and for better results we need to design our complex animations (like a character climbing a 2D tree for example) starting from a point that matches a 2D position. An insteresting thing to do would be a MAX script that snaps an object to the closest matching screen position. But again that's not something that we can do without the exact camera parameters.

Alternatively, if this difference between WME and MAX is caused by a bug that you don't have time to fix, as I believe it is, we can help fix it if you want.

Thanks,
Olivier

Logged
I am the Milkman. My milk is good.

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: Wide scenes and 3D actors
« Reply #14 on: November 20, 2006, 06:51:39 PM »

Well, something like this:

Code: [Select]
D3DXMatrixPerspectiveFovLH(&matProj, m_FOV, ViewportWidth/ViewportHeight, m_NearClipPlane, m_FarClipPlane);
Where m_FOV is the FOV read from 3DS file, or the overriden one.
Scrolling scenes then further modify the projection matrix to change the scale and offset.
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave
Pages: [1] 2  All
 

Page created in 0.053 seconds with 23 queries.