Author Topic: Flat Shaded 3D models  (Read 3716 times)

Re: Flat Shaded 3D models
« Reply #20 on: 01 Jun 2018, 03:35 »
Oh... 3D characters in 2D background like Alone in the Dark in a module? (nod)

Crimson Wizard

  • AGS Project Tracker Admins
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    •  
    • Lifetime Achievement Award Winner
    •  
    • Crimson Wizard worked on a game that was nominated for an AGS Award!
      Crimson Wizard worked on a game that won an AGS Award!
Re: Flat Shaded 3D models
« Reply #21 on: 01 Jun 2018, 10:14 »
TBH, I think it would be better to move rendering code to plugin, if you find a way to transfer drawing surface or bitmap pointer between script and plugin code.

Scavenger

  • Cavefish
  • In Four Glorious Colours!
    • I can help with animation
    •  
    • I can help with backgrounds
    •  
    • I can help with characters
    •  
    • I can help with scripting
    •  
    • Scavenger worked on a game that was nominated for an AGS Award!
      Scavenger worked on a game that won an AGS Award!
Re: Flat Shaded 3D models
« Reply #22 on: 01 Jun 2018, 11:55 »
TBH, I think it would be better to move rendering code to plugin, if you find a way to transfer drawing surface or bitmap pointer between script and plugin code.

Yeah, it's perfectly possible, you can edit a sprite like it was an array in the plugin code, which is how I do all my graphical effects. I'd do it myself if I could understand the code, which is a long way off yet. My C++ isn't good enough to handle it, unless there is a lot of overlap between the AGSScript and C.

Additionally, is it possible to reverse the projection, so that if I point at certain screen coords, I could find out which polygon is being rendered there? It doesn't have to be particularily fast, but it'd be useful in making a painting tool.

Crimson Wizard

  • AGS Project Tracker Admins
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    •  
    • Lifetime Achievement Award Winner
    •  
    • Crimson Wizard worked on a game that was nominated for an AGS Award!
      Crimson Wizard worked on a game that won an AGS Award!
Re: Flat Shaded 3D models
« Reply #23 on: 01 Jun 2018, 12:46 »
Additionally, is it possible to reverse the projection, so that if I point at certain screen coords, I could find out which polygon is being rendered there? It doesn't have to be particularily fast, but it'd be useful in making a painting tool.

This is done with raycast, that's all I know.

Khris

    • Lifetime Achievement Award Winner
    •  
    • I can help with play testing
    •  
    • I can help with scripting
    •  
    • I can help with translating
    •  
    • Khris worked on a game that was nominated for an AGS Award!
Re: Flat Shaded 3D models
« Reply #24 on: 01 Jun 2018, 12:49 »
Yeah, you need to turn the mouse coordinates into 3D camera screen coordinates, unproject them into the world, then intersect the line camera-mouse with all triangles. Then find the closest one of all that get hit.