Jump to content

  • Log In with Google      Sign In   
  • Create Account

Gavin Williams

Member Since 04 Dec 2010
Offline Last Active Yesterday, 03:03 AM

Topics I've Started

How do i lock pointer to window or set pointer position?

05 September 2015 - 09:07 AM

I have a UWP application in C#, I'm using an independent input source for the SwapChainPanel (not sure if that's relevant or not). But I can't work out how to either lock the mouse to the window or force the mouse position. This is for a first person mouse controller, so i really need to stop the mouse from leaving the window because I lose mouse control. It may even be the case that i need to lock the mouse to the swap chain panel.

I thought CoreIndependentInputSource.SetPointerCapture() would do the trick, but no. And i don't see any way to set the mouse position manually.

 

Does anyone have experience with this ?


Convert index<1> idx in parallel_for_each to integer index

07 January 2015 - 01:11 AM

HI,

 

I'm using C++ AMP to generate textures, but I can't work out how to get the array index. I need the index so that i can compute {x,y}, as I have coordinate derived data. The index is of type index<1> which doesn't seem to represent an integer and there is no cast available. The error I get is ..

no suitable conversion function from Concurrency::index<1> to "unsigned int" exists. (nor for any other types)

 

Just to clarify, I am already using (index<1> idx) to access my captured data:

				// update pixelData element
				nativePixelDataView[idx] = pixelAsInt;

Still a little confused about changing structs

29 December 2014 - 06:48 PM

Hi,

 

I'm still a bit confused about structs being copied when they are modified. I have a ray class, with two vectors ...

 

    public class Ray
    {
        public Vector3 Origin { get; set; }
        public Vector3 Direction { get; set; }

        public Ray(Vector3 origin, Vector3 direction)
        {
            Origin = origin;

            direction.Normalize();
            Direction = direction;

            /* this doesn't work*/
            //Direction = direction;
            //Direction.Normalize();
        }

What I don't get is why direction.Normalize() modifies direction, but Direction.Normalize() doesn't modify Direction.

Edit : My running theory, is that after Normalize is called, both direction and Direction are copies local to the constructor, and in the first case, it is actually assigned to the global, but in the second, it is left unused.


How can i establish a wifi-direct connection ?

10 December 2014 - 01:14 PM

Hi,

 

I want to setup a Windows Runtime 8.1 - Windows Runtime 8.1 / Phone 8.1 server and client using Wifi-Direct. But I have had absolutely no success in writing an application that can do even the most simple of tasks, My PC doesn't even see any other wifi-direct devices using the MS samples. In my own code I get one breaking issue after another ... Can someone please talk me through setting up a basic application that can establish a wifi-direct connection between my pc and my laptop (or lumia 520).

My intention is to be able to stream arbitrary data from my pc to a wifi-direct device (phone, pc or custom hardware).


Exporting non-indexed vertex data from 3DSMAx

05 July 2014 - 09:36 AM

Hi,

 

I'm trying to export model data from 3DSMax to be used in my own program, but it seems that any export (eg OBJ) always outputs the vertex data in an unusable format. I am not currently using a model library, I'm loading/using raw vertex data. So I need the vertex data as just that ... vertex data. I'm not using indices, as I want hard edges.

eg:

Vertex 1 : position, normal, texcoord

Vertex 2 : position, normal, texcoord

etc

Take a look at the OBJ file for a cube, below. that vertex data can't be used to reconstruct a cube ! There needs to be 36 vertices for a cube, but only the normals are presented in the correct way. There is face data, but I can't make sense of it, normally such facet data would be referred to as index data, and it would reference the vertices by index. But the face data is indexed upto 36, and there are only 8 vertices in this file description.

Can anyone help me export models in a usable format ?

# 3ds Max Wavefront OBJ Exporter v0.97b - (c)2007 guruware
# File Created: 06.07.2014 01:05:57

#
# object Box001
#

v  -8.5282 0.0000 16.5679
v  15.5268 0.0000 16.5679
v  -8.5282 0.0000 -13.1042
v  15.5268 0.0000 -13.1042
v  -8.5282 29.3498 16.5679
v  15.5268 29.3498 16.5679
v  -8.5282 29.3498 -13.1042
v  15.5268 29.3498 -13.1042
# 8 vertices

vn 0.0000 -1.0000 -0.0000
vn 0.0000 -1.0000 -0.0000
vn 0.0000 -1.0000 -0.0000
vn 0.0000 -1.0000 -0.0000
vn 0.0000 -1.0000 -0.0000
vn 0.0000 -1.0000 -0.0000
vn 0.0000 1.0000 -0.0000
vn 0.0000 1.0000 -0.0000
vn 0.0000 1.0000 -0.0000
vn 0.0000 1.0000 -0.0000
vn 0.0000 1.0000 -0.0000
vn 0.0000 1.0000 -0.0000
vn 0.0000 0.0000 1.0000
vn 0.0000 0.0000 1.0000
vn 0.0000 0.0000 1.0000
vn 0.0000 0.0000 1.0000
vn 0.0000 0.0000 1.0000
vn 0.0000 0.0000 1.0000
vn 1.0000 0.0000 -0.0000
vn 1.0000 0.0000 -0.0000
vn 1.0000 0.0000 -0.0000
vn 1.0000 0.0000 -0.0000
vn 1.0000 0.0000 -0.0000
vn 1.0000 0.0000 -0.0000
vn 0.0000 0.0000 -1.0000
vn 0.0000 0.0000 -1.0000
vn 0.0000 0.0000 -1.0000
vn 0.0000 0.0000 -1.0000
vn 0.0000 0.0000 -1.0000
vn 0.0000 0.0000 -1.0000
vn -1.0000 0.0000 -0.0000
vn -1.0000 0.0000 -0.0000
vn -1.0000 0.0000 -0.0000
vn -1.0000 0.0000 -0.0000
vn -1.0000 0.0000 -0.0000
vn -1.0000 0.0000 -0.0000
# 36 vertex normals

vt 0.0000 0.0000 0.0000
vt 1.0000 0.0000 0.0000
vt 0.0000 1.0000 0.0000
vt 1.0000 1.0000 0.0000
vt 0.0000 0.0000 0.0000
vt 1.0000 0.0000 0.0000
vt 0.0000 1.0000 0.0000
vt 1.0000 1.0000 0.0000
vt 0.0000 0.0000 0.0000
vt 1.0000 0.0000 0.0000
vt 0.0000 1.0000 0.0000
vt 1.0000 1.0000 0.0000
# 12 texture coords

g Box001
f 1/10/1 3/12/2 4/11/3
f 4/11/4 2/9/5 1/10/6
f 5/9/7 6/10/8 8/12/9
f 8/12/10 7/11/11 5/9/12
f 1/5/13 2/6/14 6/8/15
f 6/8/16 5/7/17 1/5/18
f 2/1/19 4/2/20 8/4/21
f 8/4/22 6/3/23 2/1/24
f 4/5/25 3/6/26 7/8/27
f 7/8/28 8/7/29 4/5/30
f 3/1/31 1/2/32 5/4/33
f 5/4/34 7/3/35 3/1/36
# 12 faces

PARTNERS