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: Accessing D3D objects from a plugin  (Read 2197 times)

0 Members and 1 Guest are viewing this topic.

CrashTheuniversE

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 6
    • View Profile
Accessing D3D objects from a plugin
« on: April 29, 2006, 05:54:19 PM »

I've seen in the doc that I can access D3DDevice and DDrawInterface ...
Could someone make an example? Maybe in the wiki?

I could be in need of changing culling from CW to CCW or vice versa sometimes. So instead of having it as a new feature,
I was thinking about making a plug-in that could give a little bit more access to the 3D renderer.

Thank you all.
Logged

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: Accessing D3D objects from a plugin
« Reply #1 on: April 30, 2006, 08:31:13 AM »

In plugin you should be able to do something like this to query the D3D device:

Code: [Select]
LPDIRECT3DDEVICE8 Device = (LPDIRECT3DDEVICE8)Game->GetProperty("Direct3DDevice")->GetValInt();
Device->SetRenderState(D3DRS_CULLMODE, D3DCULL_CCW);

But changing the render state probably won't work because WME will revert it back before rendering the model.
You can control the backface culling by setting the Actor3D.DrawBackfaces attribute, though. Although you can't set clockwise culling this way, only counter-clockwise or none.
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave
 

Page created in 0.05 seconds with 23 queries.