Please login or register.

Login with username, password and session length
Advanced search  

News:

This forum provides RSS feed. To query recent posts use this url. More...


Author Topic: How to (re)set the view transformation  (Read 2762 times)

0 Members and 1 Guest are viewing this topic.

pix

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 2
    • View Profile
How to (re)set the view transformation
« on: February 11, 2008, 05:33:21 PM »

Does anybody know how to manually set the view transformation in a 3d project?

I managed to get the view matrix via a wme_plugin which registers for WME_EVENT_SCENE_DRAW_{BEGIN,END}. In the 3d-demo I added the following to the front scene init-script:
Code: [Select]
var d3d = new Sample(0); //based on wme_sample plugin
d3d.Run(); // like the wme weather demo
WaitFor(d3d);

Each time the view reloads I log the view matrix:
Code: [Select]
D3DMATRIX* pMatrix = new D3DMATRIX();
LPDIRECT3DDEVICE9 pD3DDevice = (LPDIRECT3DDEVICE9)
Game->GetProperty("Direct3DDevice")->GetValInt();

HRESULT result
= pD3DDevice->GetTransform(
        D3DTS_VIEW,
pMatrix);
// ...
// Error handling
// Logging, etc.

But when I try to set the transform nothing happens and the matrix stays the same.
Is there something I missed? Is the view transform internally setted after the draw begin event processing?

I am unfortunetly running out of time writing my seminar paper about this topic, so every suggestion and help is very much appreciated.

Thx,
pix.
Logged

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: How to (re)set the view transformation
« Reply #1 on: February 11, 2008, 10:53:13 PM »

Is the view transform internally setted after the draw begin event processing?
Well, yes, the scene sets the "camera" in process of painting its content. What are you trying to achieve?
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

pix

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 2
    • View Profile
Re: How to (re)set the view transformation
« Reply #2 on: February 12, 2008, 10:52:54 AM »

Thanks for the fast reply :)

I want to implement a "Matrix"-like camera effect between some special scene transitions, like switching the view to the opposite side in a single room.

That would not only look great, it probably spares the player from getting confused about the position of his character in the room, because we are crossing the line of action.

I think WME has the capabilities for this kind of effect, the only thing that is needed would be an event right after the setting of the view transform  (so it can be overridden), or placing the camera initialization code before the WME_SCENE_DRAW_BEGIN event processing.

It would be really great if you consider to implement that minor code change.

Greetz,
pix.

Logged
 

Page created in 0.035 seconds with 20 queries.