Outerra forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

Outerra Tech Demo download. Help with graphics driver issues

Pages: [1] 2

Author Topic: Importing building from sketchup with texture  (Read 14145 times)

M7

  • Hero Member
  • *****
  • Posts: 736
  • newbie
Importing building from sketchup with texture
« on: April 16, 2013, 03:38:13 pm »

I've been trying to import buildings from a  sketchup .dae file. First i convert jpg images to dds using Nvidia photoshop plugin. Then i opened the empire_state.dae file with wordpad. i replaced all .jpg and .png name with .dds.

i load up Outerra and import the empire_state.dae and here what i'm getting... some textures did appear on the ouside faces of the building and some appeared on the inside. Anybody have an idea as to what went wrong?

I'm still happy that i got some textures to show up correctly though.




Logged

M7

  • Hero Member
  • *****
  • Posts: 736
  • newbie
Re: Importing building from sketchup with texture
« Reply #1 on: April 16, 2013, 04:16:18 pm »

Think i know what i did wrong. In photoshop i did resized the texture using 'image size' instead of using 'canvas size' command. In sketchup, if resize a texture (using photoshop) and do through 'image size', the texture show up all distorted. So it might be the reason why the textures show on the wrong side of the building faces in Outerra.
Logged

M7

  • Hero Member
  • *****
  • Posts: 736
  • newbie
Re: Importing building from sketchup with texture
« Reply #2 on: April 16, 2013, 04:42:11 pm »

Hmm, using 'canvas size' instead of 'image size' didn't do anything :-(
Logged

Timmo

  • Member
  • **
  • Posts: 77
Re: Importing building from sketchup with texture
« Reply #3 on: April 16, 2013, 06:56:22 pm »

It's probably because some faces are turned inwards (in sketchup, these appear as a more purple shade when untextured)- These may need to be turned outwards as a lot of 3D engines cull the backfaces of planes to improve performance?
Logged

M7

  • Hero Member
  • *****
  • Posts: 736
  • newbie
Re: Importing building from sketchup with texture
« Reply #4 on: April 16, 2013, 09:21:30 pm »

On the left, i kept the sketchup file pretty much as is with lots of hierarchy of components and groups. The  grenade launcher and the gun on top were quite deep in the hierarchy. That might be the reason the texture does not come out right.

On the right, i exploded all groups and  components and kept only the chassis and the 8 wheels components. All textures look ok.

Was also successfull to import it as vehicle  but could not use cameni's tank script yet. Will try to make a video (Haven't figured that out yet).




« Last Edit: April 16, 2013, 09:23:13 pm by M7 »
Logged

M7

  • Hero Member
  • *****
  • Posts: 736
  • newbie
Re: Importing building from sketchup with texture
« Reply #5 on: April 17, 2013, 12:04:43 am »

OK my first video ever on youtube. The sound is pretty bad even in the original wav file (so i added music). Will have to read again the video thread.

 I just want to add that it's an amazing experience to get to play with 3dr party models and incorporate them into the game engine. Great job Outerra team! This thing is such a beauty! (the engine)



« Last Edit: April 17, 2013, 02:05:29 am by M7 »
Logged

M7

  • Hero Member
  • *****
  • Posts: 736
  • newbie
Re: Importing building from sketchup with texture
« Reply #6 on: April 17, 2013, 12:39:51 am »

I exploded all the components and group. Still nothing changes



Quote
It's probably because some faces are turned inwards (in sketchup, these appear as a more purple shade when untextured)- These may need to be turned outwards as a lot of 3D engines cull the backfaces of planes to improve performance?

I checked the sketchup model without the texture and all external face look the same ....
Logged

ZeosPantera

  • ||>>-Z-<<||
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2519
  • #1 Outerra Fan Boy
    • My Youtube
Re: Importing building from sketchup with texture
« Reply #7 on: April 17, 2013, 12:53:58 am »

I just want to add that it's an amazing experience to get to play with 3dr party models and incorporate them into the game engine. Great job Outerra team! This thing is such a beauty!

Are you waiting to release until you get it all settled?
Logged
"Fear accompanies the possibility of death, Calm shepherds its certainty" - General Ka Dargo

M7

  • Hero Member
  • *****
  • Posts: 736
  • newbie
Re: Importing building from sketchup with texture
« Reply #8 on: April 17, 2013, 01:58:00 am »

Well here it is. Its the first time i share something with google drive, so i'm not sure it will work right away

https://docs.google.com/file/d/0B96RrTcNJsI2VHJOYXU2S2QtYTA/edit?usp=sharing
Logged

ZeosPantera

  • ||>>-Z-<<||
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2519
  • #1 Outerra Fan Boy
    • My Youtube
Re: Importing building from sketchup with texture
« Reply #9 on: April 17, 2013, 03:29:55 am »

Tweaky Tweaky..

Code: [Select]
//invoked only the first time the model is loaded, or upon reload
function init_chassis()
{
  var wheelparam = {
    radius: 0.6,
    width: 0.265,
    suspension_max: 1.0,
    suspension_min: -0.20,
    suspension_stiffness: 14.0,
    damping_compression: 0.05,
    damping_relaxation: 0.2,
    slip: 0.70,
    roll_influnce: 0.1,
    rotation: -1,   
}
 
  this.add_wheel('wheel_0', wheelparam);
  this.add_wheel('wheel_1', wheelparam);
  this.add_wheel('wheel_2', wheelparam);
  this.add_wheel('wheel_3', wheelparam); 
  this.add_wheel('wheel_4', wheelparam);
  this.add_wheel('wheel_5', wheelparam);
  this.add_wheel('wheel_6', wheelparam);
  this.add_wheel('wheel_7', wheelparam);
 
  //sounds
  this.load_sound("diesel-engine-start.ogg");
  this.load_sound("diesel-engine-idle.ogg");
  this.add_sound_emitter("wheel_0");
 
  return {mass:7315, steering:2.0, steering_ecf:20, centering:2.0, centering_ecf: 20,
  com:{z:0.8, y:-0.6, x:2 }};
}

//invoked for each new instance of the vehicle
function init_vehicle()
{
  this.set_fps_camera_pos({x:1.7,y:-1.0,z:3.6});
  this.snd = this.sound();
  this.snd.set_ref_distance(0, 9.0);

  this.started = 0;
}

function engine(start)
{
  if(start) {
    this.started=1;
    this.snd.play(0, 0, false, false);
  }
}


const EF = 12000.0;
const BF = 4000.0;
const maxkmh = 40;
const forceloss = EF / (0.4*maxkmh + 2);


//invoked each frame to handle inputs and animate the model
function update_frame(dt, engine, brake, steering)
{
  var kmh = this.speed()*3.6;
 
  //reduce engine force with speed (hack)
  var redux = engine>=0 ? 0.2 : 0.6;
  var esign = engine<0 ? -1 : 1;
  engine = EF*Math.abs(engine);
  var force = (esign>0) == (kmh>=0)
        ? engine/(redux*Math.abs(kmh) + 1)
        : engine;
  force -= forceloss;
  force = Math.max(0.0, Math.min(force, engine));
  engine = esign*force;


  steering *= 0.40;
  this.steer(0, steering);
  this.steer(1, steering);
  this.steer(2, steering);
  this.steer(3, steering);
  this.steer(4, -steering);
  this.steer(5, -steering);
  this.steer(6, -steering);
  this.steer(7, -steering);
 
 
  if(this.started>1)
    this.wheel_force(0, engine);
    this.wheel_force(1, engine);
    this.wheel_force(2, engine);
    this.wheel_force(3, engine);
    this.wheel_force(4, engine);
    this.wheel_force(5, engine);
    this.wheel_force(6, engine);
    this.wheel_force(7, engine);
 
  brake *= BF;
  this.wheel_brake(-1, brake);

  if(this.started==1 && !this.snd.is_playing(0)) {
    this.started=2;
    this.snd.play(0, 1, true, false);
  }
  else if(this.started==2) {
    var pitch = Math.abs(kmh)/20.0;
    var g = kmh>0 ? Math.floor(pitch) : 0;
    var f = pitch - g;
    f += 0.5*g;
    this.snd.set_pitch(0, 0.5*f + 1.0);
  }
  this.animate_wheels(); 
}


Give that a whirl. I also attached it.
« Last Edit: April 17, 2013, 03:54:53 am by ZeosPantera »
Logged
"Fear accompanies the possibility of death, Calm shepherds its certainty" - General Ka Dargo

M7

  • Hero Member
  • *****
  • Posts: 736
  • newbie
Re: Importing building from sketchup with texture
« Reply #10 on: April 17, 2013, 10:38:53 am »

that's cool! actually i was not sure how these things were driving in real life so i tried to make it look a bit like it was driving like a tank, by giving  all wheel  a very low turning rate. But i just saw it's actually driving like a tatra. I'll have to check more in detail to see what other tweaks you made.
Logged

ZeosPantera

  • ||>>-Z-<<||
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2519
  • #1 Outerra Fan Boy
    • My Youtube
Re: Importing building from sketchup with texture
« Reply #11 on: April 17, 2013, 12:45:52 pm »

Basically Less Tire Grip, Less Power, More steering lock but much slower at speed.. I played with the Center of gravity for a while. That is easiest done by setting the spring really low and the dampening to 0.. Then you can see how she leans and adjust. Also softened up the suspension a bunch and tried to make it so when you stopped short you got a bit of a rock forward before returning to rest. Raised the Max KPH to 80 from 60.
Logged
"Fear accompanies the possibility of death, Calm shepherds its certainty" - General Ka Dargo

M7

  • Hero Member
  • *****
  • Posts: 736
  • newbie
Re: Importing building from sketchup with texture
« Reply #12 on: April 17, 2013, 01:13:47 pm »

Sounds good. I have this other one that i'm looking to import. I found out it has the axles modeled so might be interesting to try to replicate how each axle move. i think the front 4 wheels are on the same axle, then separate axle for each wheels (same for the 4 back). I have an idea as how these should behave but not sure if it's possible to script with outerra bones. Think i could be in for a week to try to figure this stuff out :-)


Logged

ZeosPantera

  • ||>>-Z-<<||
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2519
  • #1 Outerra Fan Boy
    • My Youtube
Re: Importing building from sketchup with texture
« Reply #13 on: April 17, 2013, 03:10:10 pm »

Probably not possible yet in OT.. There was the discussion on getting a standard 4-link to work and that stuff isn't implemented yet.

That looks more like the tatra's suspension.
Logged
"Fear accompanies the possibility of death, Calm shepherds its certainty" - General Ka Dargo

M7

  • Hero Member
  • *****
  • Posts: 736
  • newbie
Re: Importing building from sketchup with texture
« Reply #14 on: April 17, 2013, 03:26:12 pm »

yeah just saw that discussion. Might try a fake animation with just the axles and wheels (no chassis), something similar to hhrhhr buggy, just to learn how these things work. That buggy looks so cool.
Logged
Pages: [1] 2