.b3d file wont load

Blitz3D Forums/Blitz3D Beginners Area/.b3d file wont load

Trigger1000(Posted 2015) [#1]
Hello, I am trying to imort a 3d model with animations, but I run into a problem.
I have the model as 3 different formats; .ms3d, .b3d, .3ds.
When I try to import it into my program, only the .3ds file works

ninja = LoadMesh("ninja.3ds")
PositionEntity ninja,+0,2,0
PositionEntity ninja,0,-1,0
RotateEntity ninja, 270,180,0

When I try

ninja = LoadMesh("ninja.b3d")
PositionEntity ninja,+0,2,0
PositionEntity ninja,0,-1,0
RotateEntity ninja, 270,180,0

It says that the entity doesnt exist. I have all the files saved in the same folder, so the problem isn't that the program and files aren't saved into the same folder.
It would be very appreciated if someone would help.
Thank you


RemiD(Posted 2015) [#2]
http://www.blitzbasic.com/b3ddocs/command.php?name=LoadAnimMesh&ref=3d_a-z


Trigger1000(Posted 2015) [#3]
Thanks for the link, but there is a problem still, when i checked the fiiles, the 3ds file doesn't have an animation to the model. The b3d and ms3d files do have animations to them


Guy Fawkes(Posted 2015) [#4]
You have to use "LoadAnimMesh()". NOT: "LoadMesh()".


Trigger1000(Posted 2015) [#5]
I did, but it still says the entity doesn't exist. When I say I checked the 3ds file, I mean on the 3d model viewer "Open 3d Model Viewer" that shows the animations on the files, and the 3ds file has no animations.

ninja = LoadAnimMesh("ninja.b3d")
PositionEntity ninja,+0,2,0
PositionEntity ninja,0,-1,0
RotateEntity ninja, 270,180,0

Even using the "LoadAnimMesh()" command, it doesn't work


Guy Fawkes(Posted 2015) [#6]
Try exporting it in another animation program.


Trigger1000(Posted 2015) [#7]
The problem was still there.

Here is a link to download the project
https://www.mediafire.com/?4vclbn2a25zv7zd


Guy Fawkes(Posted 2015) [#8]
You keep trying to use "Animate()" INSIDE the loop function...

You should ONLY do that if you HAVE to specify the frame range.

Anyways, try this:

Main.bb:



Load World.bb:



Good luck with your project!

Hope that helps!

P.S. you might want to "pivot" (I'm assuming this is YOUR head), pivot YOUR head onto the ninja's head so it follows the head's rotations, positions, and scales.


Trigger1000(Posted 2015) [#9]
Thank you for the time to help me. I apologize though that the same error comes up, it keeps saying the entity "ninja" does not exist.
I replaced both of the codes to match yours, but as I said, the error still comes up


Guy Fawkes(Posted 2015) [#10]
Try this:

Load World.bb:



You forgot to "Global" Ninja.


Trigger1000(Posted 2015) [#11]
Does it work for you when you run it?
For some reason it still doesn't work when I run it.
Again, thank you for helping me with this


GfK(Posted 2015) [#12]
I reckon you're using an out-of-date version of Blitz3D.

Have you got the latest update from Account>>Product Updates? Earlier versions of Blitz3D did not support .B3D format.


Guy Fawkes(Posted 2015) [#13]
What GFK said. You need to update your version of Blitz3D. Cuz' when I compile it, it works just fine.


Trigger1000(Posted 2015) [#14]
Thank you, I was using an outdated version.
But could I possibly get help on how you were saying i should "pivot" the head so it follows the rotations and transitions on the animation?
Thanks again for the help


Guy Fawkes(Posted 2015) [#15]
Use the "FindChild" function. Look up its definition.


Trigger1000(Posted 2015) [#16]
I have looked up "FindChild" and I dom't understand what you mean.


Guy Fawkes(Posted 2015) [#17]
http://www.blitzbasic.com/b3ddocs/command.php?name=FindChild&ref=3d_a-z


Trigger1000(Posted 2015) [#18]
I've read that, but i still don't seem to fully understand, I know I need to parent the head to the ninja's "skeleton". But as I said, I don't understand how.


Guy Fawkes(Posted 2015) [#19]
Find the "Head bone" & EntityParent the head onto the ninja head.


Trigger1000(Posted 2015) [#20]
So do I do

Print FindChild(ninja,"head_bone")
EntityParent(mesh,head_bone)

Or what? I'm really sorry, I'm not familier with the "FindChild" command


Guy Fawkes(Posted 2015) [#21]
I'm not doing it ALL for you.

Grab the name of bone that is the ninja's head, use find child to grab it, and parent the head onto the bone.


RGR(Posted 2015) [#22]
Main.bb



Load World.bb




Trigger1000(Posted 2015) [#23]
Thank you, sorry for the long reply, I've been away from my laptop