[Bf-committers] Compiling NDOF plugin on VC2005ce

Ettore Pasquini ettore_pasquini at 3dconnexion.com
Fri Jul 13 00:24:30 CEST 2007


On 7/11/07 7:24 PM, "sfogoros" <sfogoros at att.net> wrote:

> Scaling; ah, the original windows plugin had scaling. But, there seemed
> to be something wrong with the way transpose was implemented and I've
> been working on a re-write. I moved scaling out of the plugin. Later,
> when UI is set up for ndof devices, the user will have control of
> individual axis scaling.

I added scaling in the plugin just as a quick and dirty solution. I agree
that scaling should be done outside.

> I currently receive integer values from the [non-scaling] plugin in the
> range +-200 on each axis. I am using the event.u.spwData.period value to
> normalize the axes over time by dividing each axis value by period.
> Period ranges from 20 to 50 depending on the update rate (20 on release
> build, 45 on debug build) using the default startup objects of cube,
> lamp, and camera. I end up with axes values in the range of +-5.0. I
> also added additional scaling to the rotation axes. These values work
> very well with the transpose code I wrote. I posted an example of the
> transpose code on June 17.
> 
> Does your plugin produce these ranges?

At the moment I don't have a windows machine handy to empirically verify the
values. I can say that all 3Dconnexion drivers return values with 10 bits
resolution, and we can assume the raw range returned by the driver is more
or less +/-500.  However, since we are using "our" drivers, the user already
has full control to modify the sensitivity (ie the ranges) of each
individual axis, by using the system Preference Pane/control panel. For our
purposes, I usually just code for the default settings.

Hope this helps,

Ettore



> 
> sfogoros wrote:
>> Note: re-post of off list email by Ettore Pasquini:
>> 
>> On 7/11/07 1:29 PM, "sfogoros" <sfogoros at att.net> wrote:
>> 
>>>> In the mean time, can you provide a binary for me to use? I would like
>>>> to finish working on the viewmoveNDOF() code using the NDOF branch
>> and I
>>>> only have this development environment at the moment.
>> 
>> I attached a build of the plugin. Let me know if you have problems with it.
>> 
>>>> I noticed in your plugin the following:
>>>> 
>>>> sNdofStatus->tx = ndofData[0];
>>>> sNdofStatus->ty = ndofData[1];
>>>> sNdofStatus->tz = -ndofData[2];
>>>> sNdofStatus->rx = (GHOST_TInt16)(ndofData[3] * ang) << 4;
>>>> sNdofStatus->ry = (GHOST_TInt16)(ndofData[4] * ang) << 4;
>>>> sNdofStatus->rz = (GHOST_TInt16)(ndofData[5] * ang) << 4;
>>>> 
>>>> Is this consistent with the mac plugin range of values? I plan on
>>>> receiving raw output from the plugin and any scaling occur at the UI
>>>> level. The values and range I've been writing to are from the original
>>>> polling plugin from the patch tracker,
>>>> 
>> 
https://projects.blender.org/tracker/index.php?func=detail&aid=3688&group_id=>>
9
>>>> &atid=127
>>>> , 3dconnectionplugin.cpp:ndofEventHandler().
>> 
>> 
>> I added some scaling because the rotation output was really much much slower
>> than the translations. If you want I can rebuild the plugin without
>> the  "<< 4" shifting. I actually don't remember if the cause of that was
>> smaller absolute values for rotations, or maybe other scaling done by
>> blender somewhere else. It's probably the latter. Let me know and I can
>> rebuild it for you.
>> 
>> Ettore
>> 
>> Ps.
>> Sorry for making you take this off the list -- these observations are
>> actually in-topic with bf-committers and useful to others. Feel free to
>> repost to the list. Let's keep only the SDK talk off bf-committers. My bad,
>> sorry again. :-)
>> 
>> 
>> 
>> Ettore Pasquini wrote:
>>> The cityfly demo is based off the old Windows SDK. The old SDK still works,
>>> but we don't support it anymore officially.
>>> 
>>> I asked internally here at 3Dx and apparently it IS possible to remove the
>>> ATL dependencies and still use our new SDK. It will just take more code on
>>> the plugin side. Check out our latest sample code, I believe one of the
>>> demos doesn't link to ATL. I won't go into more details because it is maybe
>>> off topic but feel free to email me at ettore_pasquiniFFFF at
>>> 3dconnexionSSSS.com (remove the 8 caps characters).
>>> 
>>> Thing is, the objective of my plugins was to deliver something quick because
>>> we'd like to demo blender at Siggraph. So I just used all the facilities I
>>> had at my disposal to do this  (and everything that can help me to deal with
>>> Windows is fine by me ;-)). Personally, I think Microsoft should make their
>>> dev tools identical and free for everyone to solve these problems.
>>> 
>>> Ettore
>>> 
>>> 
>>> On 7/11/07 6:17 AM, "sfogoros" <sfogoros at att.net> wrote:
>>> 
>>>> Hi Ettore,
>>>> 
>>>> Thanks so much for your support and work on Blender. I notice you
>>>> represent 3dConnexion. I appreciate the opportunity to work with you on
>>>> this project.
>>>> 
>>>> I based my question regarding atl and COM on the cityfly demo in
>>>> 3DxWare-SDK_v2-0-4_win32.zip version of the SDK. I didn't research it
>>>> and I'm not very familiar with atl and COM programming. I mentioned COM
>>>> in my post because I didn't notice COM being used in cityfly. COM
>>>> shouldn't be a problem in vc2005ce. atl on vc2005ce is missing
>>>> atltypes.h I got the following errors during build:
>>>> 
>>>> d:\program files\microsoft platform sdk for windows server 2003
>>>> r2\include\atl\atlcom.h(3242) : error C2065: '_Module' : undeclared
>>>> identifier
>>>> d:\program files\microsoft platform sdk for windows server 2003
>>>> r2\include\atl\atlcom.h(3242) : error C2228: left of '.Lock' must have
>>>> class/struct/union
>>>>          type is ''unknown-type''
>>>> d:\program files\microsoft platform sdk for windows server 2003
>>>> r2\include\atl\atlcom.h(3244) : error C2228: left of '.Unlock' must have
>>>> class/struct/union
>>>>          type is ''unknown-type''
>>>> d:\program files\microsoft platform sdk for windows server 2003
>>>> r2\include\atl\atlcom.h(3366) : error C2228: left of '.CreateInstance'
>>>> must have class/struct/union
>>>>          type is ''unknown-type''
>>>> d:\program files\microsoft platform sdk for windows server 2003
>>>> r2\include\atl\atlcom.h(3373) : error C2228: left of '.Lock' must have
>>>> class/struct/union
>>>>          type is ''unknown-type''
>>>> d:\program files\microsoft platform sdk for windows server 2003
>>>> r2\include\atl\atlcom.h(3375) : error C2228: left of '.Unlock' must have
>>>> class/struct/union
>>>>          type is ''unknown-type''
>>>> d:\program files\microsoft platform sdk for windows server 2003
>>>> r2\include\atl\atlcom.h(3641) : error C2228: left of
>>>> '.m_csTypeInfoHolder' must have class/struct/union
>>>>          type is ''unknown-type''
>>>> d:\program files\microsoft platform sdk for windows server 2003
>>>> r2\include\atl\atlcom.h(3658) : error C2228: left of '.AddTermFunc' must
>>>> have class/struct/union
>>>>          type is ''unknown-type''
>>>> d:\program files\microsoft platform sdk for windows server 2003
>>>> r2\include\atl\atlcom.h(3667) : error C2228: left of
>>>> '.m_csTypeInfoHolder' must have class/struct/union
>>>>          type is ''unknown-type''
>>>> d:\program files\microsoft platform sdk for windows server 2003
>>>> r2\include\atl\atlwin.h(155) : error C2228: left of '.GetModuleInstance'
>>>> must have class/struct/union
>>>>          type is ''unknown-type''
>>>> d:\program files\microsoft platform sdk for windows server 2003
>>>> r2\include\atl\atlwin.h(168) : error C2228: left of '.GetModuleInstance'
>>>> must have class/struct/union
>>>>          type is ''unknown-type''
>>>> d:\program files\microsoft platform sdk for windows server 2003
>>>> r2\include\atl\atlwin.h(1753) : error C2065: 'i' : undeclared identifier
>>>> d:\sfogoros\projectsvc\3dcnxplug\3dcnxplug-win\windows\3dcnxplug-stdafx.h(5
>>>> 1)
>>>> : fatal error C1083: Cannot open include file: 'atltypes.h': No such
>>>> file or directory
>>>> 
>>>> I searched the Internet and found that vc2005ce does not install with
>>>> atltypes.h. Other programmers have had to write their own in order to
>>>> use atl on vc2005ce. I hesitate to do that on Blender if another
>>>> solution is possible.
>>>> 
>>>> Can the plugin work without atl?
>>>> 
>>>> Thanks again, SteveF
>>>> 
>>>> 
>>>> Ettore Pasquini wrote:
>>>>> Hi Steve,
>>>>> 
>>>>> sorry that I missed your email.
>>>>> I compiled the plugin on VS2005 professional ed, I haven't had the chance
>>>>> to
>>>>> use the community edition. I'm not much of a Windows person, honestly, but
>>>>> when I developed the plugin I had to use COM and dynamically link to ATL.
>>>>> You need COM because our SDK is based on a COM interface, and that's what
>>>>> we
>>>>> support. The current sample code reflects this AFAIK. I'm kinda thinking
>>>>> you're using maybe old sample code?
>>>>> 
>>>>> Ettore
>>>>> 
>>>>> 
>>>>> On 7/6/07 9:58 PM, "sfogoros" <sfogoros at att.net> wrote:
>>>>> 
>>>>>> Ettore,
>>>>>> 
>>>>>> I tried to compile the windows plugin on vc2005 community edition (the
>>>>>> free one). It errors on missing an atl include file. This is a known
>>>>>> issue with vc2005ce. It doesn't have the include file. I was looking at
>>>>>> the 3dConnexion samples and they don't use COM or require atl. Would you
>>>>>> help convert the plugin to the more simple implementation?
>>>>>> 
>>>>>> Steve



More information about the Bf-committers mailing list