ATTENTION

This FlexSim Community Forum is read-only. Please post any new questions, ideas, or discussions to our new community (we call it Answers) at https://answers.flexsim.com/. Our new Question & Answer site brings a modern, mobile-friendly interface and more focus on getting answers quickly. There are a few differences between how our new Q&A community works vs. a classic, threaded-conversation-style forum like the one below, so be sure to read our Answers Best Practices.


flexsim.com

Go Back   FlexSim Community Forum > FlexSim Software > Q&A
Downloads

Q&A Using Flexsim and building models

  #1  
Old 10-12-2010
Chunyan Liang Chunyan Liang is offline
Flexsim User
 
Join Date: Sep 2010
Posts: 3
Downloads: 37
Uploads: 0
Thanks: 5
Thanked 0 Times in 0 Posts
Rep Power: 0
Chunyan Liang is on a distinguished road
Default Problems about tansparency

I tried to make a big box which contains a small box. The big box is a tank. The small box that represents water in the tank is draw by drawcube() command in the tank's Custom Draw Code trigger. I would like to make the big box transparent in order to have a look at the quantity of water. So I used Glass texture for big box and it became transparent. But when I tried to draw the small box. Is it not visiual. What's the problem?

Thanks for your help!
Attached Files
File Type: zip test.zip (81.5 KB, 133 views)
  #2  
Old 10-13-2010
Jason Lightfoot Jason Lightfoot is offline
Flexsim Consultant
 
Join Date: Aug 2007
Location: Somerset, UK
Posts: 719
Downloads: 20
Uploads: 0
Thanks: 123
Thanked 953 Times in 446 Posts
Rep Power: 773
Jason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond repute
Default

It's about the order in which things are drawn. By returning 1/true you can prevent the default drawing and draw the Box object yourself and so control that order.

Code:
drawtomodelscale(current);
double currentContent = getvarnum(current, "curcontent");
double maxContent = getvarnum(current, "maxcontent");
double height = (currentContent/maxContent)* getnodenum(spatialsz(current));
drawcube(0, 0, 0, 1, 1, height, 0, 0, 0, 0, 0, 255);
drawtoobjectscale(current);
drawobject(view,getshapeindex("fs3d\\General\\Box.3ds"),gettextureindex("fs3d\\Glass.bmp"));
return 1;
The Following User Says Thank You to Jason Lightfoot For This Useful Post:
Chunyan Liang (10-14-2010)
  #3  
Old 10-14-2010
Chunyan Liang Chunyan Liang is offline
Flexsim User
 
Join Date: Sep 2010
Posts: 3
Downloads: 37
Uploads: 0
Thanks: 5
Thanked 0 Times in 0 Posts
Rep Power: 0
Chunyan Liang is on a distinguished road
Default

Hi Jason,

Thanks for your reply. But when I write your code in my model, it still does not work. I still cannot see the small box inside.
  #4  
Old 10-15-2010
Jason Lightfoot Jason Lightfoot is offline
Flexsim Consultant
 
Join Date: Aug 2007
Location: Somerset, UK
Posts: 719
Downloads: 20
Uploads: 0
Thanks: 123
Thanked 953 Times in 446 Posts
Rep Power: 773
Jason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond repute
Default

Could you check that the shape and texture are both loaded into the media list by running the following commands in script windows? They should return a positive number if loaded.
getshapeindex("fs3d\\General\\Box.3ds")
and then
gettextureindex("fs3d\\Glass.bmp")
Also you can check the list directly under the menu Tools->MediaFiles.
The Following User Says Thank You to Jason Lightfoot For This Useful Post:
Chunyan Liang (10-17-2010)
  #5  
Old 10-17-2010
Jason Lightfoot Jason Lightfoot is offline
Flexsim Consultant
 
Join Date: Aug 2007
Location: Somerset, UK
Posts: 719
Downloads: 20
Uploads: 0
Thanks: 123
Thanked 953 Times in 446 Posts
Rep Power: 773
Jason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond repute
Default

You will probably need to remove the 3D Shape reference in the General tab and in version 4 the drawshape should probably be:

Code:
drawobject(view,getshapeindex("fs3d\\texturebox.wrl"),gettextureindex("fs3d\\Glass.bmp"));
Attached is the V4 model.
Attached Files
File Type: zip TestModel_v4.zip (40.2 KB, 129 views)
The Following User Says Thank You to Jason Lightfoot For This Useful Post:
Chunyan Liang (10-17-2010)


Thread Thread Starter Forum Replies Last Post
Problems with the file Ariel Estrada Pre-sales Questions 5 06-21-2010 10:01 AM
4.5 download problems Shankar Narayan Installation 2 03-10-2009 04:25 PM
Problems with wrl file Steven Hamoen Q&A 1 01-25-2008 06:00 AM
Graphics problems Yaghm Installation 5 09-28-2007 02:12 PM


All times are GMT -6.
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, vBulletin Solutions Inc.
Copyright 1993-2018 FlexSim Software Products, Inc.