[Solved]This not Work. :(

Started by Yue, September 02, 2017, 01:29:20

Previous topic - Next topic

Yue

This is very strange, I have the following code, but it doesn't work.

jugador.malla = LoadObjectWithChildren("Yue.x")
//SetObjectRotation ( jugador.malla, 0, 180, 0 )
Local  traMalla  As Integer

traMalla = LoadImage("Astronauta_body_1_D.png")
SetImageWrapU(traMalla,1)
SetImageWrapV( traMalla,1)

SetObjectImage(jugador.malla,traMalla,0)



But if at the end of the file I place this



j As integer
t as integer

j = LoadObjectWithChildren("Yue.x")
t = LoadImage("Astronauta_body_1_D.png")
SetImageWrapU(t,1)
SetImageWrapV( t,1)
SetObjectImage(j,t,0)
SetObjectScalePermanent( j, 12, 12, 12 )


2 Models x ok.

Yue


// ************************************************* //
// Proyecto : Mars. //
// Programador : Yue Rexie. //
// Sitio Web : http://www.iris3dgames.com //
// Nombre Archivo   : Variables.agc //
// ************************************************* //
// Notas : DefiniciĆ³n de variables //
// ************************************************* //

//  Varias.
Local camara = 1
Global pantalla as TPantalla
Global raton as TRaton

Global dx as float
Global dy as float



// Jugador.
Local jugador As TJugador

jugador.pivote = CreateObjectBox(0.5,0.5,0.5)
SetObjectVisible( jugador.pivote, 0 )
jugador.camara = CreateObjectCone(1,1,16)


FixObjectToObject( jugador.camara, jugador.pivote )
SetObjectRotation( jugador.camara, 0, 0, 0)
SetObjectPosition( jugador.camara, 0, 0, -90 )
SetObjectColor( jugador.camara, 255, 0, 0, 255 )
SetObjectScale( jugador.camara, 0.1, 0.1, 0.1 )

jugador.malla = LoadObjectWithChildren("Yue.x")
//SetObjectRotation ( jugador.malla, 0, 180, 0 )
Local  traMalla  As Integer

traMalla = LoadImage("Astronauta_body_1_D.png")
SetImageWrapU(traMalla,1)
SetImageWrapV( traMalla,1)

SetObjectImage(jugador.malla,traMalla,0)
//SetObjectUVScale(traMalla, 6, 512, 512)

SetObjectScalePermanent( jugador.malla, 12, 12, 12 )

Local posJugador As Integer 
posJugador =  CreateVector3( 0.0, 23, 0.0 )
Local rotJugador As Integer
rotJugador = CreateVector3( 0.0, 0.0, 0.0 )

//FixObjectToObject( jugador.pivote, jugador.malla )
// Controlador Jugador.
Create3DPhysicsCharacterController( jugador.malla, 1, posJugador, rotJugador, 0.5 )
Set3DPhysicsCharacterControllerJumpSpeed( jugador.malla, 10 )
Set3DPhysicsCharacterControllerMaxSlope( jugador.malla, 45 )
DeleteVector3( posJugador )
DeleteVector3( rotJugador )

Global rotacion As TRotacion

// Solved Problem. 2 models with textures ok.
j As integer
t as integer

j = LoadObjectWithChildren("Yue.x")
t = LoadImage("Astronauta_body_1_D.png")
SetImageWrapU(t,1)
SetImageWrapV( t,1)
SetObjectImage(j,t,0)
SetObjectScalePermanent( j, 12, 12, 12 )




The only thing I can think of is that something strange happens between loading the first model and then it is converted into a character controller.


Yue

The conspiracy theory I have is that a mesh cannot be a character controller of the bullet physics system. So I'm gonna trade that for a simple bucket and then put the mesh in the bucket.

Yue

Eureka!!, the error is when I set the mesh as a bullet character controller.

Closed case, I already forgot what I wanted to do... if it was a video game or fill a crossword puzzle, most of the time I'm deciphering cuneiform writing from times past.




Qube

Regarding your spaceman texture issue, I was just going to post that this works :


spacemanModel = LoadObjectWithChildren( "spacemanModel.x" )
spacemanTexture = LoadImage( "spacemanTexture.png" )
SetImageWrapU( spacemanTexture, 1 )
SetImageWrapV( spacemanTexture, 1 )
SetObjectImage( spacemanModel, spacemanTexture, 0 )


But I see you've already figured it out :)
Mac Studio M1 Max ( 10 core CPU - 24 core GPU ), 32GB LPDDR5, 512GB SSD,
Beelink SER7 Mini Gaming PC, Ryzen 7 7840HS 8-Core 16-Thread 5.1GHz Processor, 32G DDR5 RAM 1T PCIe 4.0 SSD
MSI MEG 342C 34" QD-OLED Monitor

Until the next time.

Naughty Alien

..dear Yue..that was replied to you in post 7 .. what was there to discover..anyway, im glad it worked.. :)