简体   繁体   中英

WPF 3D extrude “a bitmap”

I'm looking for a way to simulate a projector in wpf 3D :

i've these parameters : 参数:

  • beam shape : a black and white bitmap file

  • beam size ( ex : 30 °)

  • beam color

  • beam intensity ( dimmer )

  • projector position (x,y,z)

  • beam position (pan(x),tilt(y) relative to projector)

First i was thinking of using light object but it seem that wpf can't do that

So, now i think that i can make for each projector a polygon from my bitmap...

First i need to convert the black and white bitmap to vector. Only Simple shape ( bubble, line,dot,cross ...)

Is there any WPF way to do that ? Or maybe a external program file (freeware);

then i need to build the polygon, with the shape of the converted bitmap , color , size , orientation in parameter.

i don't know how can i defined the lenght of the beam , and if it can be infiny ...

To show the beam result, i think of making a room ( floor , wall ...) and beam will end to these wall...

i don't care of real light render ( dispersion ...) but the scene render has to be real time and at least 15 times / second (with probably from one to 100 projectors at the same time), information about position, angle,shape,color will be sent for each render...

Well so, i need sample for that, i guess that all of these things could be useful for other people

If you have sample code :

Convert Bitmap to vector Extrude vectors from one point with a angle parameter until collision of a wall Set x,y position of the beam depend of the projector position Set Alpha intensity of the beam, color

Maybe i'm totally wrong and WPF is not ready for that , so advise me about other way ( xna,d3D ) with sample of course ;-)

Thanks you

I would represent the "beam" as a light. I'd load the bitmap into a stencil buffer. You should be able to do this with OpenGL, DirectX, or XNA. AFAIK, WPF doesn't give access to the hardware for stencil buffers or shadows.

It seam to do "light patterns on the floor" there is two way

use a spotlight with a cookie. Or Projector with a custom shader that does additive blending.

or manually creating partially transparent polygons to simulate the "rays". and i need some example for one or the other case

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM