October 26, 2020, 01:02:40 AM

Author Topic: Using Blitz3D need help with Entity & Mesh & Surface  (Read 579 times)

Offline JBR

  • Full Member
  • ***
  • Posts: 113
Using Blitz3D need help with Entity & Mesh & Surface
« on: June 11, 2020, 12:56:41 AM »
I want to get the surface of an entity so I can read out the VertexX, etc.

When I was using miniB3d I cast lyne_surf = GetSurface( TMesh(lyne), 1 ) and it worked fine.

But Blitz3D does not allow this, and it throws up a MAV on the TFormPoint line.

Help. :-)




Code: [Select]
lyne = Make_Line_No_Triangles( ship\constant, A_Ref_Ship(ship\constant)\A_Lines_V0[kk], A_Ref_Ship(ship\constant)\A_Lines_V1[kk] , scale)

lyne_surf = GetSurface( lyne, 1 )

;vertices
;--------
For vert% = 0 To 12-1
TFormPoint VertexX(lyne_surf, vert), VertexY(lyne_surf, vert), VertexZ(line_surf, vert), lyne, 0 ; To the real world

VertexCoords all_lines_surface, kk*12 + vert, TFormedX(), TFormedY(), TFormedZ()
Next

Offline STEVIE G

  • Sr. Member
  • ****
  • Posts: 492
Re: Using Blitz3D need help with Entity & Mesh & Surface
« Reply #1 on: June 11, 2020, 07:26:26 AM »
Should work fine, assuming at least 12 verts have been created. I would check countvertices for that surface. You sure it's not the line below? Curious as to why you need 12 verts for a 3d line too?

Offline JBR

  • Full Member
  • ***
  • Posts: 113
Re: Using Blitz3D need help with Entity & Mesh & Surface
« Reply #2 on: June 11, 2020, 09:43:28 PM »
Hi Stevie,

12 verts to make a hexa-line.

Should work but it does not.

Would you like a look at the whole source?

Thanks, Jim.

Offline JBR

  • Full Member
  • ***
  • Posts: 113
Re: Using Blitz3D need help with Entity & Mesh & Surface
« Reply #3 on: June 11, 2020, 10:17:21 PM »
Hi, found the error :-[

TFormedZ was using line_surf where it should have been lyne_surf.

I did your countvertices and it was 12 then I saw the variable line_surf and realised ……..

Thanks again, Jim.

Offline STEVIE G

  • Sr. Member
  • ****
  • Posts: 492
Re: Using Blitz3D need help with Entity & Mesh & Surface
« Reply #4 on: June 12, 2020, 09:17:14 AM »
Interesting concept - hex lines. Is this for 3d wireframe? Any screenshots?

Offline JBR

  • Full Member
  • ***
  • Posts: 113
Re: Using Blitz3D need help with Entity & Mesh & Surface
« Reply #5 on: June 12, 2020, 08:30:40 PM »
Hi, yes essentially the same as a one surface particle system but I'm drawing lines.

Beauty is I can update a ship a line at a time, or 4, or any number really.

I need to scale the lines depending on distance but want to avoid an entity for each line.

Here's a little demo of a craft.

https://www.youtube.com/watch?v=vSWWBrqUTTk

Jim.

Offline hosch

  • Jr. Member
  • **
  • Posts: 83
Re: Using Blitz3D need help with Entity & Mesh & Surface
« Reply #6 on: June 13, 2020, 03:11:56 PM »
Hi, yes essentially the same as a one surface particle system but I'm drawing lines.

Beauty is I can update a ship a line at a time, or 4, or any number really.

I need to scale the lines depending on distance but want to avoid an entity for each line.

Here's a little demo of a craft.

https://www.youtube.com/watch?v=vSWWBrqUTTk
Wow this looks very cool! Reminds me of Elite. What are you planning to do with this?

Offline JBR

  • Full Member
  • ***
  • Posts: 113
Re: Using Blitz3D need help with Entity & Mesh & Surface
« Reply #7 on: June 13, 2020, 11:14:59 PM »
Hopefully a game similar to the Elite style but more combatant.

Jim.

Offline Steve Elliott

  • Hero Member
  • *****
  • Posts: 2819
  • elgol 2021
Re: Using Blitz3D need help with Entity & Mesh & Surface
« Reply #8 on: June 13, 2020, 11:28:26 PM »
Loving the vectors!
Windows 10, 64-bit, 16Gb RAM, CPU Intel i5, 3.2 GHz, Nvidia GeForce GTX 1050 (2Gb)
MacOS Catalina, 64-bit, 8Gb RAM, CPU Intel i5, 2.3 Ghz, Intel Iris Plus Graphics 640 1536 MB
Linux Mint 19.3, 64-bit, 16Gb RAM, CPU Intel i5, 3.2 GHz, Nvidia GeForce GTX 1050 (2Gb)
Raspberry Pi 3 and 4

 

SimplePortal 2.3.6 © 2008-2014, SimplePortal