OpenSceneGraph Forum Forum Index OpenSceneGraph Forum
Official forum which mirrors the existent OSG mailing lists. Messages posted here are forwarded to the mailing list and vice versa.
 
   FAQFAQ    SearchSearch    MemberlistMemberlist    RulesRules    UsergroupsUsergroups    RegisterRegister 
 Mail2Forum SettingsMail2Forum Settings  ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
   AlbumAlbum  OpenSceneGraph IRC ChatOpenSceneGraph IRC Chat   SmartFeedSmartFeed 

How to get the normal of every triangle?


 
Post new topic   Reply to topic    OpenSceneGraph Forum Forum Index -> General [forum]
View previous topic :: View next topic  
Author Message
Wangbingqian (Bingqian Wang)
Newbie


Joined: 16 Mar 2018
Posts: 5

PostPosted: Mon Mar 19, 2018 1:53 am    Post subject:
How to get the normal of every triangle?
Reply with quote

Hi,

I know how can I get the vertex normal vector use NodeVisitor and Geometry->getNormalArray(),but how to get the normal of every triangle?

Thank you very much!

Cheers,
Bingqian
Back to top
View user's profile Send private message Send e-mail
Wangbingqian (Bingqian Wang)
Newbie


Joined: 16 Mar 2018
Posts: 5

PostPosted: Thu Apr 19, 2018 10:11 am    Post subject:
How to get the normal of every triangle?
Reply with quote

Hi,

I know how can I get the vertex normal vector use NodeVisitor and Geometry->getNormalArray(),but how to get the normal of every triangle?

Thank you very much!

Cheers,
Bingqian

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=73130#73130







------------------
Post generated by Mail2Forum
Back to top
View user's profile Send private message Send e-mail
Voerman, L.
Guest





PostPosted: Thu Apr 19, 2018 11:56 am    Post subject:
How to get the normal of every triangle?
Reply with quote

As the per primitive normal is not used by modern openGL, you probably will have to calculate it yourself from the triangle vertices:        osg::Vec3 normal = (v1-v0)^(v2-v0);
        normal.normalize();

Laurens.
ps. 
I found your mail in my spam folder, probably due to the domain of your mail adres and the very short message. 
You might improve the answers you get by expanding your message by an explanation of what you are trying to do, why you want to do that and what the problem actually is. 


On Mon, Mar 19, 2018 at 2:53 AM, Bingqian Wang < (
Only registered users can see emails on this board!
Get registred or enter the forums!
)> wrote:
Quote:
Hi,

I know how can I get the vertex normal vector use NodeVisitor and Geometry->getNormalArray(),but how to get the  normal of every triangle?

Thank you very much!

Cheers,
Bingqian

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=73130#73130





_______________________________________________
osg-users mailing list
(
Only registered users can see emails on this board!
Get registred or enter the forums!
)
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


------------------
Post generated by Mail2Forum
Back to top
Display posts from previous:   
Post new topic   Reply to topic    OpenSceneGraph Forum Forum Index -> General [forum] All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum

Similar Topics
Topic Author Forum Replies Posted
No new posts Visualizing triangle data sam General 4 Wed Jun 13, 2018 9:52 pm View latest post
No new posts VBO Bug with 3.6.1 and Normal Arrays Daniel Emminizer, Code... General 21 Fri Jun 01, 2018 3:01 pm View latest post
No new posts How to get the triangle normal vector? Wangbingqian General 0 Fri Mar 16, 2018 1:07 pm View latest post
No new posts Specifying indices of triangle vertic... antiro42 General 1 Thu Dec 21, 2017 12:44 pm View latest post
No new posts Normal Mapping using Dynamic Cubemap romulogcerqueira General 11 Tue Dec 19, 2017 2:10 am View latest post


Board Security Anti Bot Question MOD - phpBB MOD against Spam Bots
Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP