Results 1 to 9 of 9

Thread: Early black box preview of ray-mesh collisions

  1. #1
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    7,128
    Rep Power
    732

    Early black box preview of ray-mesh collisions

    Dear all,

    as you know I am writing library, which would allow us to cast rays against various objects.
    The release date is somewhere in fog , but to not torture you too much I attach executable of my thinBasic script using the early library.

    Hope you will like it. What I must work on now is speed speed speed.
    Current performance is like 1 ray colliding with 1 200 000 polygons takes second to calculate.
    That is far from ideal, as it means about 20 000 polygons to get 60FPS ... and that is for one ray.
    But I still have lot of space for optimization, don't worry

    Hope the demo will entertain you.


    Petr
    Attached Files Attached Files
    Learn 3D graphics with ThinBASIC, learn TBGL!
    Windows 10 64bit - Intel Core i5-3350P @ 3.1GHz - 16 GB RAM - NVIDIA GeForce GTX 1050 Ti 4GB

  2. #2
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    57
    Posts
    8,777
    Rep Power
    10

    Re: Early black box preview of ray-mesh collisions

    All seems working fine here.
    What is this application doing in reality? You know, I'm quite bad in understanding all those 3D complexities.

    Ciao
    Eros
    Attached Images Attached Images
    www.thinbasic.com | www.thinbasic.com/community/ | help.thinbasic.com
    Windows 10 Pro for Workstations 64bit - 32 GB - Intel(R) Xeon(R) W-10855M CPU @ 2.80GHz - NVIDIA Quadro RTX 3000

  3. #3
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    7,128
    Rep Power
    732

    Re: Early black box preview of ray-mesh collisions

    Hi Eros,

    - set of triangles ( 3d object ) is passed to module
    - I create random rays around the object, pointing to 0,0,0
    - I put point at intersection of ray and the object

    That is all You can simply cast a ray on mesh and ask for distance or point of collision.
    I should have explained better in first post, I am now half alive, half sleeping


    Petr

    Learn 3D graphics with ThinBASIC, learn TBGL!
    Windows 10 64bit - Intel Core i5-3350P @ 3.1GHz - 16 GB RAM - NVIDIA GeForce GTX 1050 Ti 4GB

  4. #4
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    57
    Posts
    8,777
    Rep Power
    10

    Re: Early black box preview of ray-mesh collisions

    now I got it.
    It is like a a laser hitting a surface and at the intersection point you see the light.
    www.thinbasic.com | www.thinbasic.com/community/ | help.thinbasic.com
    Windows 10 Pro for Workstations 64bit - 32 GB - Intel(R) Xeon(R) W-10855M CPU @ 2.80GHz - NVIDIA Quadro RTX 3000

  5. #5

    Re: Early black box preview of ray-mesh collisions

    Nice one. Its a dino but I don't know it's name.

  6. #6
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    7,128
    Rep Power
    732

    Re: Early black box preview of ray-mesh collisions

    Yes Eros,

    exactly

    Mike, it is triceratops, but that is not important
    Good thing is I got it working, now I have to add the boxes and some nice external interface.
    I started to design module in different way, less hacky, more maintainable ... but still fast.

    The speed problem is not caused by the general design but by the function itself.
    Once I get ray-box working, I will organize triangle groups in sub spaces, first test for box hit and then for triangles only when needed.


    Petr
    Learn 3D graphics with ThinBASIC, learn TBGL!
    Windows 10 64bit - Intel Core i5-3350P @ 3.1GHz - 16 GB RAM - NVIDIA GeForce GTX 1050 Ti 4GB

  7. #7
    thinBasic MVPs kryton9's Avatar
    Join Date
    Nov 2006
    Location
    Naples, Florida & Duluth, Georgia
    Age
    67
    Posts
    3,869
    Rep Power
    404

    Re: Early black box preview of ray-mesh collisions

    Hey Petr, thanks a great start!

    About your idea for sub spaces, would that be octrees that I keep reading about?
    Acer Notebook: Win 10 Home 64 Bit, Core i7-4702MQ @ 2.2Ghz, 12 GB RAM, nVidia GTX 760M and Intel HD 4600
    Raspberry Pi 3: Raspbian OS use for Home Samba Server and Test HTTP Server

  8. #8
    thinBasic MVPs
    Join Date
    May 2007
    Location
    UK
    Posts
    1,427
    Rep Power
    159
    Home Desktop : Windows 7 - Intel Pentium (D) - 3.0 Ghz - 2GB - Geforce 6800GS
    Home Laptop : WinXP Pro SP3 - Intel Centrino Duo - 1.73 Ghz - 2 GB - Intel GMA 950
    Home Laptop : Windows 10 - Intel(R) Core(TM) i5-4210U CPU @ 1.70GHz, 2401 Mhz, 2 Core(s), 4 Logical Processor(s) - 4 GB - Intel HD 4400
    Work Desktop : Windows 10 - Intel I7 - 4 Ghz - 8GB - Quadro Fx 370

  9. #9
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    7,128
    Rep Power
    732

    Re: Early black box preview of ray-mesh collisions

    Hi Michael,

    thanks for those links, I will check them in more depth.
    Some of them have fantastic results, but they need quite modern hardware and are GPU based.

    I will do classic safe CPU routines first, and then jump for this.

    The cow is nice

    Kent, I will try to do octree, as long is it will not be slowing down the calculation But I was thinking of it. Must do some tests.


    Petr
    Learn 3D graphics with ThinBASIC, learn TBGL!
    Windows 10 64bit - Intel Core i5-3350P @ 3.1GHz - 16 GB RAM - NVIDIA GeForce GTX 1050 Ti 4GB

Similar Threads

  1. thinEdge 1.0.0.6 early preview
    By Petr Schreiber in forum TBGL Modelling, 3D, other SW integration
    Replies: 13
    Last Post: 20-02-2007, 01:06

Members who have read this thread: 0

There are no members to list at the moment.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •