ReactVision / viro

ViroReact: The AR and VR library for React Native 📳💙💛🤍💚
MIT License
1.3k stars 150 forks source link

FBX - VRX Model Not Behaving / Draggable Like OBJ #172

Open JamesRMorey opened 1 year ago

JamesRMorey commented 1 year ago

MAC RN - 0.6 IOS and Android ViroReact V2.2 Testing device is iPhone 11 but on all others too

I have created an AR scene with ViroReact on both IOS and Android. The scene works great with OBJ files and textures, I can drag the objects around and the snap to planes.

The issue occurs when I try and use and animated model. I convert the FBX file to VRX using the converter and although the model looks a bit mashed it is ok and the animation works. However, the model just stays in one place on the phone screen, is not snapping to planes, is about 1000X as big as it was before (I know it can be scaled and has in the video) and is no longer draggable.

https://user-images.githubusercontent.com/13592068/195662167-88e8580e-56f9-421c-95ac-f9a345cead77.mov

Scene Code (same as obj which works, just swapped model to vrx)

 <ViroARScene>
    <ViroAmbientLight color="#ffffff" />
        <Viro3DObject 
        source={require('../../models/vampire/source/vampire.vrx')}
        materials={['../../models/vampire/source/Vampire.png']}
        animation={{
            name: 'Vampire_Armature|AnimationTest',
            run: true,
            loop: true,
            delay:1000
            }}
        position={[0.0, 0.0, -30]}
        rotation={[0,0,0]}
        scale={[0.0005, 0.0005, 0.0005]}
        type="VRX"
        dragPlane={{
            planeNormal: [0, 0, 0],
            planePoint: [0, 0, -2],
            maxDistance: 10,
        }}
        onDrag={(event) => {}}
        dragType="FixedToWorld"                    
        highAccuracyEvents={true}
        />
</ViroARScene>

As I say the scene works perfectly with an OBJ, but once switched to VRX this happens. Any help greatly appreciated.

Muhammad-Usama-lab commented 1 year ago

@JamesRMorey did you find any solution to this?

robertjcolley commented 5 months ago

Can you share the VRX or OBJ file you're using?

JamesRMorey commented 5 months ago

Hi,

I don’t have the models as it was about a year ago I was trying to use them, but honestly it was every single model I ran through that converter came out mashed. The ones I found online that were already converted worked nicely.

Sorry that’s not much help, I remember speaking to quangvrstyler in the discord about it a while ago and he mentioned the requirements for a successful convert, these models probably didn’t meet them but were well animated and made models. I remember getting them off sketchfab, I’m not a model maker.

Thanks

James

On Wed, 31 Jan 2024 at 15:43, Robert Colley @.***> wrote:

Can you share the VRX or OBJ file you're using?

— Reply to this email directly, view it on GitHub https://github.com/NativeVision/viro/issues/172#issuecomment-1919371606, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADHWMBAILNDHHHZF6BE564LYRJRDJAVCNFSM6AAAAAAREPUCPGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMJZGM3TCNRQGY . You are receiving this because you were mentioned.Message ID: @.***>