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
    6,800
    Blog Entries
    3
    Rep Power
    694

    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 7 64bit - Intel Core 2 Duo T6600 @ 2.2GHz - 4 GB RAM - NVIDIA GeForce G210M 512MB
    Windows 8 64bit - Intel Core i5-3350P @ 3.1GHz - 8 GB RAM - NVIDIA GeForce GT640 3GB

  2. #2
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    50
    Posts
    8,198
    Blog Entries
    2
    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 Thumbnails Attached Thumbnails Click image for larger version. 

Name:	Rays.jpg 
Views:	94 
Size:	38.2 KB 
ID:	5168  
    www.thinbasic.com | www.thinbasic.com/community/ | psch.thinbasic.com
    Win10Pro 64bit - 8GB Ram - Intel i7 M620 2.67GHz - NVIDIA Quadro FX1800M 1GB

  3. #3
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    6,800
    Blog Entries
    3
    Rep Power
    694

    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 7 64bit - Intel Core 2 Duo T6600 @ 2.2GHz - 4 GB RAM - NVIDIA GeForce G210M 512MB
    Windows 8 64bit - Intel Core i5-3350P @ 3.1GHz - 8 GB RAM - NVIDIA GeForce GT640 3GB

  4. #4
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    50
    Posts
    8,198
    Blog Entries
    2
    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/ | psch.thinbasic.com
    Win10Pro 64bit - 8GB Ram - Intel i7 M620 2.67GHz - NVIDIA Quadro FX1800M 1GB

  5. #5
    thinBasic MVPs Michael Hartlef's Avatar
    Join Date
    Sep 2006
    Location
    Leverkusen, Germany
    Age
    51
    Posts
    3,281
    Blog Entries
    2
    Rep Power
    340

    Re: Early black box preview of ray-mesh collisions

    Nice one. Its a dino but I don't know it's name.
    Running Windows 7 Home, 64 bit, 8 GB ram, Athlon II X2 255, ATI Radeon HD 4200.

  6. #6
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    6,800
    Blog Entries
    3
    Rep Power
    694

    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 7 64bit - Intel Core 2 Duo T6600 @ 2.2GHz - 4 GB RAM - NVIDIA GeForce G210M 512MB
    Windows 8 64bit - Intel Core i5-3350P @ 3.1GHz - 8 GB RAM - NVIDIA GeForce GT640 3GB

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

    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
    Blog Entries
    1
    Rep Power
    153
    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
    6,800
    Blog Entries
    3
    Rep Power
    694

    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 7 64bit - Intel Core 2 Duo T6600 @ 2.2GHz - 4 GB RAM - NVIDIA GeForce G210M 512MB
    Windows 8 64bit - Intel Core i5-3350P @ 3.1GHz - 8 GB RAM - NVIDIA GeForce GT640 3GB

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

Posting Permissions

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