Petr,
this is perfect for a new M15 native function, isn't it?
Eros
Hi Simone,
to get model width/height you can use following SUB:
[code=thinbasic]
sub Model_GetWidthHeight( model as long, byref width as double, byref height as double )
local i as long
local x, y as double
local minx as double = 1000
local miny as double = 1000
local maxx as double =-1000
local maxy as double =-1000
for i = 1 to tbgl_m15GetModelVertexcount(model)
x = tbgl_m15GetVertexX(model, i)
y = tbgl_m15GetVertexY(model, i)
minx = min(x, minx)
miny = min(y, miny)
maxx = max(x, maxx)
maxy = max(y, maxy)
next
width = maxx - minx
height = maxy - miny
end sub
[/code]
You just pass model slot, and two variables BYREF.
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
Petr,
this is perfect for a new M15 native function, isn't it?
Eros
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
One more thing,
Patrice Terrier had nice suggestion for his BassBox player, which we can apply too.
Currently, game uses almost 100% CPU, but if you put:
... on the line right after center cursor, we get 2 cool things:sleep 10
- Process will use 0 to 6% of CPU, while still open to run at 100 FPS
- Mouse input will work better
Eros, your wish is my command ;D. I will make it in way it will return even the z size.
Bye and thanks a lot for new version!,
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
thank you very much Petr,
tonight I try to implement it in the script and manage models of paddle.
Simone
LapTop Pc: 2GHz Intel Core 2 Duo T7200 • 2GB 533MHz DDR2 RAM • 160GB hard disk • 512MB ATi Mobility Radeon X1600 graphics • Win Vista SP1<br />Desktop Pc: 1.6GHz Intel Core 2 • 2GB DDR2 RAM • 1024MB Nvidia GeForce 8800 GT • WinXp SP3
Simone thanks for the update. Good luck on next version... excited to see it when it is out!
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
Hi Simone,
I developed function TBGL_m15GetModelDimensions, which could be used for the job. You will find it in next thinBASIC release.
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
Very much needed and appreciated function, Petr
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
thanks petr, your suggestion for calculate the width and height of a model, works very well.
I'm wait the new thinbasic version for try the new feature.
Simone
LapTop Pc: 2GHz Intel Core 2 Duo T7200 • 2GB 533MHz DDR2 RAM • 160GB hard disk • 512MB ATi Mobility Radeon X1600 graphics • Win Vista SP1<br />Desktop Pc: 1.6GHz Intel Core 2 • 2GB DDR2 RAM • 1024MB Nvidia GeForce 8800 GT • WinXp SP3
Hi,
I have update the first post with new version of Arkanoid.
Where there is a first test of bonuses.
The bonuses in the script for now are two:
- change the width of paddle;
- possibility of multi ball.
I hope it is the right way to take.
Ciao,
Simone
LapTop Pc: 2GHz Intel Core 2 Duo T7200 • 2GB 533MHz DDR2 RAM • 160GB hard disk • 512MB ATi Mobility Radeon X1600 graphics • Win Vista SP1<br />Desktop Pc: 1.6GHz Intel Core 2 • 2GB DDR2 RAM • 1024MB Nvidia GeForce 8800 GT • WinXp SP3
Simone!,
that is very nice version! And I see you prepared a lot for future - model size check is there.
My favourite bonus is multiball, it really doubles the fun.
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
Bookmarks