Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / SetObjectCullMode () causes weirdness!

Author
Message
basicFanatic
7
Years of Service
User Offline
Joined: 7th Jun 2017
Location:
Posted: 28th Mar 2018 20:29 Edited at: 28th Mar 2018 21:09
After too much coffee, I used an entire night to think about a potential VR / Leap Motion art toy, inspired from the psychedelic effect you get when you direct a camcorder towards a monitor showing the recording.

Today I just had to make it. I had some problems with the VR add-on screwing with my camera settings, but I was able to crudely hack my way around that.

But there was another problem: I needed to be able to mirror a plane object. I thought the clever way was to use SetObjectCullMode ( canvasPlane, 2 ) and for a while it worked ... but then I noticed that whatever was rendered behind the plane got rendered as if it was in front!

I need this in real-time so image memblocks are out of the question.

I guess mesh object memblocks could do the trick ... somehow.

There's a shader listed at the button of this thread, but I couldn't figure out how to use it. Isn't I'm supposed to load both a .vs and a .ps file?
https://forum.thegamecreators.com/thread/219157
Bengismo
6
Years of Service
User Offline
Joined: 20th Nov 2017
Location: Yorkshire, England
Posted: 28th Mar 2018 22:07 Edited at: 28th Mar 2018 22:08
Hmm...it should still work fine but im not sure what else your doing that might be causing the problem??


If you carefully set the UV values you can have it in any orientation you like....

You could go to the trouble of creating a memblock and making two triangles then setting the UV values correctly to show a reverse image from your camera but that requires knowledge of memblocks and coding them.

You could write a custom shader to do the UV transform -- but that would require knowledge of writing shaders.

Or you could just create 2 triangles in a 3D editor (3DS max, Blender, Milkshape3d, Wings 3d, etc...) and then load that into AGK. You can set the UV's to be reversed then and it requires no code.
<-- playing a video to an image on a face

Then you can show the image left to right or up to down....etc...


In theory you could just use SetObjectUVScale(Plane, -1.0,1.0) but images wont wrap properly unless they are square powers of 2, which your camera output almost certainly wont be.
basicFanatic
7
Years of Service
User Offline
Joined: 7th Jun 2017
Location:
Posted: 28th Mar 2018 23:08
Quote: "Hmm...it should still work fine but im not sure what else your doing that might be causing the problem??"


It should? Then it is likely that I screw up somehow when I tried to render. Does this code looks okay?

basicFanatic
7
Years of Service
User Offline
Joined: 7th Jun 2017
Location:
Posted: 1st Apr 2018 01:07
Well, whatever! I used the naughtiest hack of all and decided that this was a "feature", not a "bug"! Seriously though, I think it's quite fun in its current state, even though I'd love to have seen it as originally intended.

So, released!

https://kasper-hviid.itch.io/leap-of-paint

Login to post a reply

Server time is: 2024-09-30 15:38:28
Your offset time is: 2024-09-30 15:38:28