Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / load mesh problem!

Author
Message
Beyond the Humans Knowledge
15
Years of Service
User Offline
Joined: 27th Oct 2010
Location:
Posted: 1st Nov 2010 02:30
i was just messing around with darkbasic pro to learn new stuff and i cant get the load mesh to work even though i do EXACTLY the same thing that the demo projects have. here is my code. i used the hero.x model from the roomdemo. the message i get is "cant load object "guy.x" in line 9. dont bother about the rest of the code for it works but it just wont load the mesh.

sync on
sync rate 60
make object cube 1,25
make matrix 1,500,500,50,50
position matrix 1,0,0,0
load image "vizard mask.jpg",1
prepare matrix texture 1,1,50,50
make object sphere 2,25
load mesh "guy.X",3
load image "guy.tga",2
do
CX=camera position X()
CY=camera position Y()
CZ=camera position Z()
OX=object position X(3)
OY=object position Y(3)
OZ=object position Z(3)
RO=object angle X(3)
LO=object angle Y(3)
MX=mousex()
MY=mousey()
MZ=mousez()
position camera OX+100,35,OZ
point camera OX,35,OZ
if keystate(17)=1 then move object 1,2
if keystate(30)=1 then turn object left 1,2
if keystate(31)=1 then move object 1,-2
if keystate(32)=1 then turn object right 1,2
sync
loop

onhcet d(-_-)b techno
TheComet
18
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 1st Nov 2010 11:23
I'm really not sure about this, but is it possible that "guy.X" is animated, and therefore you can't load it as a mesh? Also, why do you need to load it as a mesh? Wouldn't an object be the best solution?

It might be a good idea to also post "guy.X" here so we can check it for potential errors

TheComet

Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 2nd Nov 2010 12:39
Quote: " the message i get is "cant load object "guy.x" in line 9"


I don't get that message - I get "Object does not exist at line 15". That error is correct because you don't have an object 3.

I've just tested your code using the "hero" model (confusingly called "ROOMDEMO.X" on my machine ) and your code works fine - as long as you don't try to refer to the non-existent object 3.

Meshes are NOT objects - they are used to create objects using make object. Any reason why you are using load mesh rather than load object?

I suspect the reason why you are getting an error at line 9 is that your "guy.x" model is in the wrong folder. It should be in the project folder along with the dba file and other media.

The following works for me (it looks odd because the objects need positioning and scaling and the camera needs to be repositioned). Note the line I've added.

Login to post a reply

Server time is: 2026-07-22 04:37:08
Your offset time is: 2026-07-22 04:37:08